[R] plot y1 and y2 on one graph

Gabor Grothendieck ggrothendieck at gmail.com
Thu Feb 28 02:56:24 CET 2008


There is an example in

library(zoo)
example(plot.zoo)

On Wed, Feb 27, 2008 at 5:05 PM, milton ruser <milton.ruser at gmail.com> wrote:
> Dear all
>
> I have a code like
>
> x<-1:10
> y1<-x+runif(10)*2
> y2<-seq(0,50,length.out=10)+rnorm(10)*10
>
> par(mfrow=c(1,2))
> plot(y1~x)
> plot(y2~x)
>
> 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
>
> Miltinho
>
> Brazil
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list