[R-sig-Geo] spplot with legend only, and legend inside the plotting area

Oscar Perpiñán Lamigueiro oscar.perpinan at upm.es
Wed Mar 7 17:51:51 CET 2012


Mauricio Zambrano-Bigiarini <mauricio.zambrano at jrc.ec.europa.eu> writes:

> On 07/03/12 13:11, Oscar Perpiñán Lamigueiro wrote:
>> Mauricio Zambrano-Bigiarini<mauricio.zambrano at jrc.ec.europa.eu>  writes:
>>
> The real problem appears when I try to produce several spplots within
> the same figure (each one of them for a different spatial area), with
> a unique legend for all the figures (that is the reason why I can not
> use 'legend' command).

Then you could use c.trellis:

With your example:

c(dummy, dummy, dummy, dummy).

Inside c() you can define the 'layout' and decide if you want to merge
legends with 'merge.legends'.

Oscar.

>
>> sessionInfo() # part of it
> R version 2.14.1 (2011-12-22)
> Platform: x86_64-redhat-linux-gnu (64-bit)
> .
> .
> .
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] sp_0.9-95         lattice_0.20-0
>
> loaded via a namespace (and not attached):
> [1] cluster_1.14.2 grid_2.14.1    Hmisc_3.9-2
>
>
> Thanks in advance,
>
> Mauricio Zambrano-Bigiarini

-- 
Oscar Perpiñán Lamigueiro
Dpto. Ingeniería Eléctrica
EUITI-UPM

http://procomun.wordpress.com



More information about the R-sig-Geo mailing list