[R] Alignment of lines within barplot bars
Greg.Snow at imail.org
Fri Apr 8 18:23:37 CEST 2011
Look at the updateusr function in the TeachingDemos package.
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of snowboarder101
> Sent: Thursday, April 07, 2011 12:38 PM
> To: r-help at r-project.org
> Subject: Re: [R] Alignment of lines within barplot bars
> I am dealing with a similar issue, I am trying to use a barplot in
> conjunction with some points plotted and want to line the two up. This
> works fine, but I am dealing with the additional complication that I
> two y-ranges. The barplot is based on one range, while the points are
> on another. The way I have been dealing with this is to use barplot(),
> then use a par(new=T), and then do the plot. So I have axis(2) with the
> points, and axis(4) with the barplot values. However, the points don't
> up. When I do it the other way and do barplot(), points() with the
> x coordinates, the range isn't correct, and not all points appear.
> I can force barplot() to use my range of points, but then the bars are
> small. I can also try to normalize my points to be in the same range as
> barplot() data, but then I have issues labeling it appropriately. That
> my axis(2) is incorrect, and I need this whole thing to function
> in a function, so I can't explicitly list the labels.
> Any thoughts on this would be appreciated.
> View this message in context: http://r.789695.n4.nabble.com/Alignment-
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help