[R] barplot - offsetting individual bars

Kevin Turner turner.kw at gmail.com
Sat Apr 24 21:04:23 CEST 2010


Hello,

I'm trying currently using barplot to summarize precipitation data.  So far
I've compiled total annual snow and rain accumulation in a table
(attached).  I've been successful at plotting it using the following code:

fig=barplot(t(Annual_Precip_table), horiz=TRUE, space=0, col=c("grey70",
"white"), axes=FALSE)
.
.
The result is a stacked barplot with total annual rain represented by grey
bars and total annual snow represented by white bars.  This is great,
however, I'd like to position the bars so that the rain bars are right
justified on the axis and the snow bars are left justified on the axis.

I looked around for ways to do this, and I'm not sure, but is plotrix
capable of doing it using the barb function?  Does anyone have experience
with this kind of plot?

Thanks.

-- 
Kevin Turner
Department of Geography
and Environmental Studies
Wilfrid Laurier University
Waterloo, Ontario


More information about the R-help mailing list