[R] Axis annotation using lattice spplot

V Zintzen vincentz at tepapa.govt.nz
Fri Sep 21 05:03:17 CEST 2012


Hi there,

I am having difficulties with what seems like a very simple thing.

My objective is to plot a distribution map for a species.
I have produced a plot with spplot which uses a raster, a few shapefiles and
xy points which are the species coordinates.
It all works fine until I want to add coordinates for this map.
I need to have the ticks and labels for those coordinates *inside* the
plotting area, not outside (outside, it works fine).
Apparently, using the code below (negatice 'tck'), the ticks are printed
inside the plotting area, but under the raster, which is not of much use to
me.

My questions are:
(1) how can I have the ticks and labels appearing on top of the raster?
(2) what are the functions to have the labels also moved on the inside of
the plotting area, sitting nicely close to the ticks?

x.labels<-c("10°","15°","20°","25°","30","35°","40°")
y.labels<-c("55°","50°","45°","40°","35°","30°","25°","20°")
spplot (  raster.map, 
                scales=list(tck=c(-0.3,0), draw=T, x=list(at=x.UTM,
labels=x.labels), y=list(at=y.UTM, labels=y.labels)), #works fine with
tck=c(0.3,0), but not with a negative value
                sp.layout=list(EEZ,coastline,sp)) #add shapefiles and the
distribution points for the selected species
                  

Any help would be greatly appreciated!
-Vincent



--
View this message in context: http://r.789695.n4.nabble.com/Axis-annotation-using-lattice-spplot-tp4643810.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list