The updateusr function in the TeachingDemos package can be used to change the user coordinates of the current plot and may do what you want.
-- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111 > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > project.org] On Behalf Of Schreiber, Stefan > Sent: Thursday, October 02, 2008 10:04 AM > To: r-help@r-project.org > Subject: [R] combining bar and line plots with multiple axes > > Hey list, > > I have a barplot with a line plot overlayed (on the 2nd y axis) and it > looks fine except that the origin (0) on the 2nd y axis (side=4) is > not > lining up with the origin on the 1st y-axis (side=2, from the barplot). > Is there a way to either shift the 2nd y-axis (line plot) down or > readjust the barplot axis? > > Just as a reference, here is the code: > > barplot2(temp$precip, names.arg=temp$year, ylim=c(0,300),axes=F) > axis(2) > par(new=T) > plot(temp$year, temp$mat, axes=F, type="l", ylim=(0,25)) > axis(4) > > > Thanks!! > > Stefan > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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@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.