[R] Histogram Bar Spacing or Border Width

Thomas Hopper tomhopper at comcast.net
Wed Feb 9 22:07:21 CET 2005


I see where you're going...yes, I could create my own histogram 
distribution from the data and plot it using barplot (in fact, I've 
already achieved the visual effect I want with barplot, so I could just 
expand on that). I'm hoping that I can find a way to do it with hist() 
to avoid duplicating the good work that has already gone in to that 
function.

Thanks,

Tom
On Feb 9, 2005, at 11:12 AM, Zachary Holden wrote:

> Tom,
> I dealt with this once.
>
>  barplot.data<- c(2,3,4,5,6)
>  x<- barplot(barplot.data, ylim = c(0,10), space= .9,.9,.9,.9)
>
> use the space= to define the spacing between each of your barplot 
> values.
> If you have groups of bars that you want together, with spaces between 
> the groups,
> you have to put 0's for each of the unspaced bars.
>
> Hope this helps,
>
> Zack
> ----- Original Message -----
> From: Thomas Hopper <tomhopper at comcast.net>
> Date: Wednesday, February 9, 2005 7:02 am
> Subject: [R] Histogram Bar Spacing or Border Width
>
>> Is there any way to control the spacing between bars in a
>> histogram, or
>> change the border width (I'm assuming the hist() function, though
>> alternatives are welcome)? I'm interested in changing the visual
>> spacing
>> between columns in a plotted histogram.
>>
>> The general effect I'm looking for can be accomplished in barplots
>> using
>> the "width=" parameter, but I have not been able to find a way to
>> adjust
>> the apparent spacing in histograms.
>>
>> Thank you,
>>
>> Tom Hopper
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! http://www.R-project.org/posting-
>> guide.html
>
>
---
"Never confuse motion with action."
                                   -Benjamin Franklin




More information about the R-help mailing list