[R] Width of bars in barplot2

Jamieson Cobleigh cobleigh at gmail.com
Wed Mar 1 19:11:50 CET 2006


Thanks.  That was all I needed.

Jamie

On 3/1/06, Marc Schwartz (via MN) <mschwartz at mn.rr.com> wrote:

> Unless you have modified the 'width' argument, the default width is 1.
>
> Thus the sides of the bars are the centers +/- 0.5.
>
> If you modified the width argument, then the widths are set to the
> vector assigned.
>
> This behavior is the same in barplot() and barplot2() by design.
>
> As an example:
>
>  # Draw a barplot. adjust the y axis to make some room
>  # above the bars
>  mp <- barplot2(1:10, ylim = c(0, 12))
>
>  # Draw lines showing the bar width limits
>  arrows(mp - 0.5, 2:11, mp + 0.5, 2:11, angle = 90, code = 3)
>
>
> HTH,
>
> Marc Schwartz
>
>
>




More information about the R-help mailing list