[R-sig-Geo] Adding map to filled.contour

Greg Snow Greg.Snow at intermountainmail.org
Fri Jun 15 18:12:17 CEST 2007


When filled.countour returns, the coordinate system does not match the
plot (part of drawing the scale).  One of the easiest ways to add to the
plot is using the plot.axes argument.  For example:

> library(maps)
> data(ozone)
> 
> fit <- loess(median ~ x+y, data=ozone)
> 
> tmp.x <- seq( min(ozone$x), max(ozone$x), length=25 )
> tmp.y <- seq( min(ozone$y), max(ozone$y), length=25 )
> 
> z <- predict(fit, expand.grid(x=tmp.x, y=tmp.y))
> z <- matrix(z, ncol=25)
> 
> filled.contour(tmp.x, tmp.y, z,
+   plot.axes=map('state',add=T)
+   )
> 

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-sig-geo-bounces at stat.math.ethz.ch 
> [mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of 
> Thomas Szegvary
> Sent: Friday, June 15, 2007 6:34 AM
> To: r-sig-geo at stat.math.ethz.ch
> Subject: [R-sig-Geo] Adding map to filled.contour
> 
> Hi there
> 
> I have a filled.contour and want to add a the contours of a 
> shapefile (i.e.
> European boarders). I tried to do this with the map library, 
> but didn't succed using par(new=TRUE) to add the boundaries, 
> the filled.contour is not a plot says R.
> What else can I do?
> Thanks,Thomas
> 
> 
> 
> __
> 
> Thomas Szegvary
> Institute of Environmental Geosciences
> Department of Geosciences
> University of Basel
> Bernoullistrasse 30
> CH - 4056 Basel
> 
> Tel.  41-61-267 04 82
> Fax. 41-61-267 04 79
> Email: t.szegvary at unibas.ch
> www.radon.unibas.ch
> www.unibas.ch/environment
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>




More information about the R-sig-Geo mailing list