[R] legend of maps generated by function symbols
Greg Snow
538280 at gmail.com
Thu Oct 18 19:13:21 CEST 2012
Possible? Yes. (see fortune("Yoda"))
Automated using the legend function? No
Automated using another function? possbly somewhere in the 4,000+
packages on CRAN, but I don't know which.
It is doable with the basic tools. You could either find a part of
your graph with open area to put the legend in, or you could use the
layout function to create a second smaller blank graph beside yours to
use for the legend. Use the rect function to draw a rectangle around
where you want the legend to be, choose some values of myvariable that
you want to show sample circles for, then use symbols again to draw
those circles and text to draw the matching values next to the
circles. The following functions may be of use in choosing how big to
make the rectangle and where to place the circles and text within the
rectangle: strwidth, strheight, grconvertX, grconvertY, and the inches
argument to symbols.
On Thu, Oct 18, 2012 at 3:31 AM, Marion Jacquot
<marion.jacquot at univ-fcomte.fr> wrote:
> I generated maps with the function symbols (graphics). These are basic maps
> generated with :
>
> symbols(x,y,circles=myvariable)
>
> where x et y are spatial coordinates corresponding to replicates of
> "myvariable".
>
> I would associate legend to this kind of maps, is it possible?
>
> Regards,
> Marion.
>
>
> --
> Marion Jacquot
> Laboratoire de Chrono-environnement
> UMR UFC/CNRS 6249 USC INRA
> Université de Franche-Comté
> Place Leclerc
> F-25030 Besançon cedex
> FRANCE
> Tel. : +33 (0)381 665 829
> Fax : +33 (0)381 665 797
> http://chrono-environnement.univ-fcomte.fr/
>
> ______________________________________________
> 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.
--
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com
More information about the R-help
mailing list