Steve Murray wrote:
Dear R Users,
I am trying to plot a barchart with a line graph superimposed (using
par(new=TRUE)). There are 12 bars and 12 corresponding points for the line
graph. This is fine, except that I'm encountering two problems:
1) The position of the points (of the line graph) a
lthcare
greg.s...@imail.org
801.408.8111
> -Original Message-
> From: Steve Murray [mailto:smurray...@hotmail.com]
> Sent: Monday, June 15, 2009 3:03 PM
> To: Greg Snow; r-help@r-project.org
> Subject: RE: [R] Aligning axis values when plotting more than one graph
> on same a
Thanks for the replies.
This is a simple example which demonstrates exactly the problems I'm facing. As
you can see, neither the x or y axes line up consistantly.
> barplot(1:12, names.arg=substr(month.abb, 1,1))
> par(new=TRUE)
> plot(1:12, 1:12, type="b", lwd=2, col="red", xaxt="n")
I'd be
Generally using par(new=T) is more complicated than it is worth, try a
different method first. One option is to use the updateusr function from the
TeachingDemos package. The first example on the help page shows adding a line
to a barplot with everything aligned, follow that example as a star
4 matches
Mail list logo