Maha,

On 08/11/2010, at 5:20 PM, govin...@msu.edu wrote:
> Thanks for the info. I got my legend inside the plot, but if i want to 
> mention the location of the legend in terms of the coordinates, then how do I 
> measure the coordinates? rather, how do i mention it for the legend's 
> location (because both "X" and "Y" axes seldom have the same units - so how 
> to figure this out?)
> 
You need to convert the axis units to the plot coordinate units - which is 
happening in the background anyway for your plot. I'm not quite sure how to 
explain this better past look again critically at the line below
> > 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 (deg C)', 
> > xlab='Year')
> 
as I suspect what you want to find the x value in something like 
as.numeric(min(date values)) - the y value should be a little easier to work 
out in this case. Again, I can only suggest use the locator() function to help 
get a feeling for what the conversions have been if you are totally lost.

As a final thought, you will probably find a lot more help on such a topic as 
generic plotting layout on the R-help list, not the geostatistics special 
interest group. Or try the Murrell book "R Graphics"

cheers

Ben




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