Hi Euan,
Another approach that I personally think is much cleaner is to use
linked micromaps, ala Dan Carr.
I have been able to do them using latticeExtra using the c() function
and you could probably do them in ggplot
using viewports. Here is a sample using laticeExtra.
http://junkcharts.typepad.com/junk_charts/2010/02/convention-and-function-2.htmlAnd here are some better examples
http://gis.cancer.gov/images/tools/lm/lm2.pngDan has code to do this on his class website, but it is structured in
such a way that you have to fix
the page size, so is not very flexible.
Hope this helps
Nicholas
> ------------------------------
>
> Message: 2
> Date: Sun, 4 Apr 2010 18:27:48 -0500
> From: Euan Reavie <
[hidden email]>
> To:
[hidden email]
> Subject: [R-sig-Geo] Adding miniature plots at specific locations on a
> map
> Message-ID:
> <
[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> 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.
>
> -Euan
> University of Minnesota Duluth.
>
>
>
> ------------------------------
_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo