[R-sig-Geo] Add text INSIDE spplot map

Tom Gottfried tom.gottfried at tum.de
Mon Jul 11 15:09:20 CEST 2011


Hi again,

Am 11.07.2011 14:32, schrieb Jose Iparraguirre:
> Thanks Tom,
>
> Here's an example using the usual dataset, meuse.
>
>> data(meuse)
>> coordinates(meuse) = ~x+y
>> l1 = list("sp.text", c(179050, 330877),"Hola",col="red",font=2)

Explicitly giving first=FALSE in this line

l1 = list("sp.text", c(179050, 330877),"Hola",col="red",font=2, first=FALSE)

does not help. I think this is not the documented behaviour, as the layout item seems to be drawn 
before the main spplot object, which corresponds to first=TRUE. I'm sure Edzer Pebesma can clarify this.

Regards!
Tom

>> spplot(meuse, c("ffreq"), sp.layout=list(l1), col.regions= "black",
> + pch=c(19), key.space=list(x=0.1,y=.95,corner=c(0,1)))
>
> Here, "Hola" is printed 'within the cloud', and it's not very legible -imagine thousands of additional points. I forgot to mention that I'd experimented with first=F/T, and the only change is that with first=TRUE, of course, the text 'Hola' is not printed.
> So, let me change the request of advice slightly: can I put such a text in such coordinates within a box, filling the box with a different colour, so that the text becomes more visible? (neither 'fill' nor 'bty' seem to work as elements of the list...).
>
> Thanks in advance, and regards to everyone!
>
> José
>
>
>
> José Iparraguirre
> Chief Economist
> Age UK
>
> T 020 303 31482
> E Jose.Iparraguirre at ageuk.org.uk
>
> Tavis House, 1- 6 Tavistock Square
> London, WC1H 9NB
> www.ageuk.org.uk | ageukblog.org.uk | @AgeUKPA
>
>
>
>
> -----Original Message-----
> From: Tom Gottfried [mailto:tom.gottfried at tum.de]
> Sent: 11 July 2011 08:00
> To: Jose Iparraguirre
> Subject: Re: [R-sig-Geo] Add text INSIDE spplot map
>
> Hi,
>
> first guess: did you try to add 'first=FALSE' to sp.layout (see ?spplot)?
>
> Am 08.07.2011 17:09, schrieb Jose Iparraguirre:
>> Hi,
>>
>> Sorry if I'm not accompanying a piece of code, but the following question is general enough.
>> I want to add some text markers/labels (say, the names of a couple of cities) within the figure plotted using spplot (in the sp library). I'm plotting spatial points.
>> Using sp.layout I can add a text outside the points, but when I change the coordinates to place the text within the cloud of points, it seems to go 'behind' the points. Is there a way of bringing the text forward or 'superimpose' it on top of the points mapped with spplot?
>
> For me it's not clear what means "outside the points" and "within the cloud of points". Maybe a
> reproducible example would clarify, though.
>
> Tom
>
>> Thanks,
>>
>> José
>>
>> José Iparraguirre
>> Chief Economist
>> Age UK
>>
>> T 020 303 31482
>> E Jose.Iparraguirre at ageuk.org.uk<mailto:Jose.Iparraguirre at ageuk.org.uk>
>>
>> Tavis House, 1- 6 Tavistock Square
>> London, WC1H 9NB
>> www.ageuk.org.uk<http://www.ageuk.org.uk>   | ageukblog.org.uk<http://ageukblog.org.uk/>   | @AgeUKPA<http://twitter.com/ageukpa>
>>
>>
>>
>>
>>
>>
>>
>>
>> Age UK  Improving later life
>>
>>
>>
>> www.ageuk.org.uk
>>
>>
>>
>>
>>
>> -------------------------------
>>
>>
>>
>> Age UK is a registered charity and company limited by guarantee, (registered charity number 1128267, registered company number 6825798)
>>
>>
>>
>> Registered office:207-221 Pentonville Road, London N1 9UZ
>>
>>
>>
>> ------------------------------
>>
>>
>>
>> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you receive a message in error, please advise the sender and delete immediately.
>>
>>
>>
>> Except where this email is sent in the usual course of our business, any opinions expressed in this email are those of the author and do not necessarily reflect the opinions of Age UK or its subsidiaries and associated companies. Age UK monitors all e-mail transmissions passing through its network and may block or modify mails which are deemed to be unsuitable.
>>
>>
>>
>> Age Concern England (charity number 261794) and Help the Aged (charity number 272786) and their trading and other associated companies merged on 1st April 2009 to form Age UK, a single charity dedicated to improving the lives of  people in later life . The three national Age Concerns in Scotland, Northern Ireland and Wales have also merged with Help the Aged in these nations to form three registered charities: Age Scotland, Age NI, Age Cymru.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>>
>>
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Technische Universität München
Department für Pflanzenwissenschaften
Lehrstuhl für Grünlandlehre
Alte Akademie 12
85350 Freising / Germany
Phone: ++49 (0)8161 715324
Fax:   ++49 (0)8161 713243
email: tom.gottfried at wzw.tum.de
http://www.wzw.tum.de/gruenland



More information about the R-sig-Geo mailing list