[R] prob with legend in my plots!

David Winsemius dwinsemius at comcast.net
Sat Nov 6 04:02:15 CET 2010


On Nov 5, 2010, at 6:59 PM, govindas at 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.

Is -1, 1 a valid location in the range and domain of the arguments?

> 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!

No, it's not. Neither is any data with which to reproduce the problem.  
Please read the Posting Guide more thoroughly.

>

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list