[R] plot y1 and y2 on one graph
jholtman at gmail.com
Wed Feb 27 23:49:44 CET 2008
This should do what you want:
par(new=TRUE) # plot on the same graph
plot(y2~x, col='red', axes=FALSE, bty='c', xlab='', ylab='')
axis(4, col.axis='red', col='red')
mtext("y2", 4, col='red', line=-2)
On Wed, Feb 27, 2008 at 5:05 PM, milton ruser <milton.ruser at gmail.com> wrote:
> Dear all
> I have a code like
> Now I would like to plot y1 and y2 on the same graph, with its two scales
> (y1 on left and y2 on rigth side).
> Any help are welcome.
> Kind regards
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem you are trying to solve? Tell me what you want to
do, not how you want to do it.
More information about the R-help