[R] Labeling a range of bars in barplot?

From: Hans Gardfjell <hans.gardfjell_at_emg.umu.se>
Date: Tue 13 Dec 2005 - 22:09:49 EST

Is this what you want...



Hans Gardfjell
Dept. of Ecology and Environmental science Umeň University, Sweden

Dan Bolser wrote:

Hi, I am plotting a distribution of (ordered) values as a barplot. I would like to label groups of bars together to highlight aspects of the distribution. The label for the group should be the range of values in those bars.

As this is hard to describe, here is an example;

x <- rlnorm(50)*2


y <- quantile(x, seq(0, 1, 0.2))



That last plot is to highlight that I want to label lots of the small columns together, and have a few more labels for the bigger columns (more densely labeled). I guess I will have to turn out my own labels using low level plotting functions, but I am stumped as to how to perform the calculation for label placement.

I imagine drawing several line segments, one for each group of bars to be labeled together, and putting the range under each line segment as the label. Each line segment will sit under the group of bars that it covers.

Thanks for any help with the above!


R-help@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 Received on Tue Dec 13 22:50:47 2005

This archive was generated by hypermail 2.1.8 : Tue 13 Dec 2005 - 23:38:01 EST