Re: [R] Alignment of lines within barplot bars

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Fri, 08 Apr 2011 10:23:37 -0600

Look at the updateusr function in the TeachingDemos package.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org
801.408.8111



> -----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
>
> Hi,
>
> 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
> all
> works fine, but I am dealing with the additional complication that I
> have
> two y-ranges. The barplot is based on one range, while the points are
> based
> on another. The way I have been dealing with this is to use barplot(),
> and
> 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
> line
> up. When I do it the other way and do barplot(), points() with the
> barplot()
> 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
> too
> small. I can also try to normalize my points to be in the same range as
> the
> barplot() data, but then I have issues labeling it appropriately. That
> is,
> my axis(2) is incorrect, and I need this whole thing to function
> dynamically
> 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-
> of-lines-within-barplot-bars-tp2533115p3434209.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Fri 08 Apr 2011 - 16:33:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 09 Apr 2011 - 03:50:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive