[R-sig-Geo] Adding miniature plots at specific locations on a map
Euan Reavie
euan.reavie at gmail.com
Mon Apr 5 21:21:38 CEST 2010
Thank you Jim and others. The subplot function does exactly what I need. For
example, the following places a small plot in the middle of Lake Superior:
> subplot(plot(sample(10,10,10)),-88,48,size=c(.3,.3))
I am also exploring some of the latticeExtra functions.
Best - Euan.
> -----Original Message-----
> From: Jim Lemon [mailto:jim at bitwrit.com.au]
> Sent: Monday, April 05, 2010 3:55 AM
> To: Euan Reavie
> Cc: r-sig-geo at stat.math.ethz.ch
> Subject: Re: [R-sig-Geo] Adding miniature plots at specific locations on a
> map
>
> On 04/05/2010 09:27 AM, Euan Reavie wrote:
> > Hello all. I have plotted a map of the Great Lakes using maptools:
> >> lakes<- readShapePoly('C:/grtlakes/',proj4string=CRS("+proj=longlat"))
> >> plot(lakes, xlim=c(-93.5,-74.5),ylim=c(41,49.5),lwd=3,new=TRUE)
> >
> > Now I want to plot small scatterplots relative to several sample
> > locations on the map. After an afternoon of trying I have not been
> > able to find a way to do this using a matrix of lat/long data (sample
> > locations). I was hoping I could implement something similar to the
> > "floating.pie" command in the plotrix package, except for scatter
> > plots. For an example of what I'm trying to do (using line plots) see
> > Fig. 1 in:
> > http://epa.gov/glnpo/monitoring/publications/articles/laurentian_II.pdf
> >
> > At this point I'm not concerned about crowding. If I can simply place
> > the small plots on a map I can figure out crowding issues later. Is
> > there a package that can do this, or can I work with the base package?
> > At this point, if i could figure out a way to assign lat/long
> > coordinates to a simple plot like:
> >> plot(sample(10,10,10))
> > ...I would be happy. Any recommendations for packages, etc. would be
> welcome.
> >
> Hi Euan,
> I think the subplot function in the TeachingDemos package might do what
> you want.
>
> Jim
More information about the R-sig-Geo
mailing list