Maha,

I suspect that the legend appears, but not within the limits of your plot. In 
this case you have an x axis that extends from ≈ year(1980) to ≈ year(2010) 
- which is 3652 - 14610, and a y axis from about 18 - 22.

Try the line below, and see if it become clear why your legend is not appearing 
at 0.1, 01

plot(0.1,0.1, xlim=c(as.numeric(as.Date('1980-01-01')), 
as.numeric(as.Date('2010-01-01'))), ylim = c(18,30), ylab='SST (dec C)', 
xlab='Year')

you might find the locator() function helpful here.

cheers

Ben






On 06/11/2010, at 9:58 AM, govin...@msu.edu wrote:

> 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!<SST_ElN3.jpeg>_______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to