[R] prob with legend in my plots!

govindas at msu.edu govindas at msu.edu
Fri Nov 5 23:59:26 CET 2010



Hi,

I have a problem with the appearance of legend in my plots. If I specify  the legend positions in characters like "topright"..etc, it appears, if  i specify it in terms of coordinates like "-1, 1" .. etc, it does not  appear. Can anyone help me with this?

script - 
x.date <- as.Date(paste(year, month, day, sep="-"))
ts1.n.e3 <- ts(data.nemr.e3[,3])
z1.n.e3 <- zoo(ts1.n.e3, x.date)
plot(z1.n.e3, ylim = c(min(data.nemr.e3[,3]), max(data.nemr.e3[,5])), col="orange",
main = "Monthly variations of SST in El-Nino3", xlab = "Year", ylab="SST (deg C)")
lines(z2.n.e3, lty = 2, col="red2")
lines(z3.n.e3, lty = 3, col="maroon3", lwd=1)
legend(-0.1, -0.1, legend=c("min", "mean", "max"), lty=c(1,2,3),
col=c("orange", "red2", "maroon3"))

attached is my plot! suggestions are welcome! thanks in advance! -- 
Regards,
Maha!


More information about the R-help mailing list