[R] How to change width of bar when there are very few bars?

Jim Lemon jim at bitwrit.com.au
Sat May 26 11:47:04 CEST 2012


On 05/26/2012 12:26 PM, Manish Gupta wrote:
> If i assign a vector with same small width for each bar (here) still both are
> same broad. I think it takes ratio for whole area.  Is there any other
> parameter to control it.? Any working example will help me.
>
>
Hi Manish,
If you are using the "barplot" function, you probably want to specify 
both "width" and "space". If you just want to specify a single number, 
look at the "barp" function in the plotrix package, where "width" is the 
parameter that controls the width of the bar as a proportion of the 
distance between bar centers. Note that you won't get different bar 
widths with barp.

Jim



More information about the R-help mailing list