Dear Maria,

I have recently been doing something similar with creating your own intervals for an spplot map.  Below is some of the code that I used for this, which I hope you can adapt for your problem (I've started to adapt the code a little given the details you provided in your posting) .

cuts_var<-c(min(var2),63.93,90,200,400,600,max(var2))  # this here create a vector with the different values you want
arrow<-list("SpatialPolygonsRescale",layout.north.arrow(), offset = c(75000,200000),scale = 75000) # this creates a north arrow if you want (you will have to adapt for your coordinate system)
scale_bar<-list("SpatialPolygonsRescale", layout.scale.bar(), offset = c(75000,150000), scale = 250000, fill=c("transparent","black")) # creates a scale bar which you will also have to adapt for your image
text1<-list("sp.text", c(100000,175000), "0", cex = .7) # this is text that comes with the start of the scale bar
text2<-list("sp.text", c(375000,175000), "250 km", cex = .7) # text that comes with the end of the scale bar
a<-as.character(cuts_var)
a1<-paste(a,a[-1],sep="-") # here you create the ranges for the legend text (you will also have to adapt this if you want to write the "under and over"
a1<-a1[1:(length(a1)-1)]
text.key<-a1

spplot(china, "var2", cuts=cuts_var, col.regions = gray(seq(0,0.999,length=100)),first=T, scales = list(draw = F),key=list(text=list(text.key,cex=0.7),rectangles=list(T,col=gray(seq(0,0.999,length=6)),columns=1),cex=0.7,title="your legend title"),key.space="right",main="your main title",sp.layout=list(arrow,scale_bar,text1,text2),
panel=function(...){
  panel.pointsplot(...)
  #sp.polygons(lakes,col="blue",zcol="FEATURE",fill="blue",colorkey=F,last=T) # shows some code for if you need to overlay any other items on your map and excludes the legend
  # sp.polygons(fl_pol_aea,col="gray80",colorkey=F,last=T)
})

Hope this will be of some help to you, good luck

Nicky

****************************
Nichola M. Knox, PhD
Post Doctoral Associate,
Soil and Water Science Department,
University of Florida,
2169 McCarty Hall,
PO Box 110290,
Gainesville, 32611, FL
Tel: 352 392 8663 (x 239)


	[[alternative HTML version deleted]]

