I've given this solution a try over the past few days. And it works very nicely. Using the layout() function I have been able to plot Sao as an inset map on a larger map of Africa.

Thanks for the tips.

On 10/16/2011 10:35 AM, Christopher S. Fowler wrote:
> I struggled with a similar issue plotting the U.S. with Hawaii and Alaska as
> insets. My result is far from perfect and my coding technique is likely
> awful, but it might provide some inspiration...
>
> http://csfowler.com/drupal/US-with-inset
>
> On Sat, Oct 15, 2011 at 8:36 AM, Edzer Pebesma <
> edzer.pebesma@uni-muenster.de> wrote:
>
>> you might want to look at maptools::elide, to shift Sao to the Africa map,
>> and perhaps rbind() the two objects into a single object for spplot.
>>
>> Alternative, pass Sao in sp.layout, but than you'd have to do the colouring
>> yourself, which might be fine if you need to do it just once.
>>
>>
>> On 10/15/2011 05:01 PM, dieter Vanderelst wrote:
>>
>>> Hello List,
>>>
>>> I have a map of Africa I plot using spplot(). In addition, I have a
>>> second map of Sao Tome (a small island). I want to add this second map
>>> to the first as an inset because it would otherwise not be visible at
>>> the same scale of the continent.
>>>
>>> This is what I currently do: I save both maps to a variable and plot
>>> them using the print.trellis function (see
>>> http://stat.ethz.ch/R-manual/**R-devel/library/lattice/html/**
>>> print.trellis.html<http://stat.ethz.ch/R-manual/R-devel/library/lattice/html/print.trellis.html>
>>> ).
>>>
>>>
>>> This is the code:
>>> p1<-spplot(Africa,c('var1'))
>>> p2<-spplot(Sao,c('var1'))
>>> print(p1,position=c(0,0,1,1),**more=T)
>>> print(p2,position=c(0,0,0.3,0.**3),more=T)
>>>
>>> This results is a map of Africa with a second map of Sao in the left
>>> bottom corner.
>>>
>>> However, the location of the inset in the larger map is difficult to
>>> control using this code. Spplot enforces the aspect ratio of the maps to
>>> be respected. Of course, this is necessary for mapping. However, this
>>> seems to conflict with the position arguments in the print statements.
>>>
>>> Does anybody have some which allows controlling the location of an inset
>>> map in a larger map?
>>>
>>> Regards,
>>> Dieter
>>>
>>> ______________________________**_________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo@r-project.org
>>> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>>>
>> --
>> Edzer Pebesma
>> Institute for Geoinformatics (ifgi), University of Münster
>> Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
>> 8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
>> http://www.52north.org/**geostatistics<http://www.52north.org/geostatistics>
>> e.pebesma@wwu.de
>>
>>
>> ______________________________**_________________
>> R-sig-Geo mailing list
>> R-sig-Geo@r-project.org
>> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>>
>
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


	[[alternative HTML version deleted]]

