[R] adding text to spplot

Weidong Gu anopheles123 at gmail.com
Wed Jul 13 16:02:44 CEST 2011


You may need panel function

spplot(enaD2, "var1.pred",sp.layout=pts, main = "globina 60 cm",
sub="D2", col.regions=terrain.colors(64), contour=T,
panel = function(x,y,z,subscripts,...) {
panel.polygonsplot(x,y,z,subscripts,...)
sp.text(coordinates(enaD2), enaD2$ime[subscripts])
}


HTH

Weidong Gu

On Wed, Jul 13, 2011 at 7:31 AM, Matevž Pavlič <matevz.pavlic at gi-zrmk.si> wrote:
> hi all,
>
>
>
> I have a plot to which i would like to add text labels. And i cant find a way...here is the code :
>
>
>
> enaD2<-idw(D2~1, loca=dva, newdata=grd)
>
> pts = list("sp.points",  dva,  pch = 20, cex=1.5, col = "darkred
>
> spplot(enaD2, "var1.pred",sp.layout=pts, main = "globina 60 cm", sub="D2", col.regions=terrain.colors(64), contour=T)
>
>
>
>
>
> text information is in ena$ime field,
>
>
>
> regards, m
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list