[R-sig-Geo] Adding miniature plots at specific locations on a map

Jim Lemon jim at bitwrit.com.au
Mon Apr 5 10:54:58 CEST 2010


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