[R] how to plot a map on a non-rectilinear grid

From: Costas Douvis <cdouvis_at_geol.uoa.gr>
Date: Mon, 17 Mar 2008 12:22:49 +0200 (EET)


Hi everyone

I have a matrix (let's say that it contains the values of elevation) and want to plot its values on a map using a function such as image.plot or filled.contour. The problem is that my grid is not rectilinear, it is bended. Here is an example

lon<-matrix(0,20,25)
lat<-matrix(0,20,25)
elev<-matrix(0,20,25)
for (i in 1:20) {
for (j in 1:25) {
  lat[i,j]<-i+((j-12.5)^2)/100
  lon[i,j]<-j+((i-10)^2)/100
  elev[i,j]<-i+j
}
}

All 3 matrices have dimensions 20x25. How can I plot elev values in the grid points defined by lat and lon?

-- 
Kostas Douvis
PhD Student
University of Athens - Department of Geography and Climatology
Academy of Athens - Research Centre for Atmospheric Physics and Climatology
email: cdouvis_at_geol.uoa.gr
tel: +30-210-8832048

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 17 Mar 2008 - 10:27:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 17 Mar 2008 - 17:30:22 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive