[R] plot focus - another issue (ylim)

pdb philb at philbrierley.com
Thu Jul 1 04:20:50 CEST 2010


Thanks Henrique, that appeared to work, but now I have another issue.

If I add a ylim to the plot then when I plot another line it gets plotted on
the wrong scale.

#this works as expected
plot(iris[,1],col="red",ylim=c(-10,10)) #plot1
lines(iris[,4],col="black") 


#this does not
par(mfrow=c(2,1))

plot(iris[,1],col="red",ylim=c(-10,10)) #plot1
plot(iris[,3],col="blue") #plot2

#goes on plot2
par(mfg = c(2, 1))
lines(iris[,2],col="pink")

#goes on plot 1
par(mfg = c(1, 1))
lines(iris[,4],col="black") 
-- 
View this message in context: http://r.789695.n4.nabble.com/plot-focus-tp2272699p2274541.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list