map legend
Sonia, it might help to send an example that we can reproduce without access to your data, in order to see what's going on. If that doesn't help, you might to ask r-help, as the legend() command is not specific to geospatial data analysis, afaics. -- Edzer
Sonia Broner - UPC wrote:
Hi list!
I`ve tried to do a choropleth map in R but I`ve had problems with the legend.
I`d like only two digits in the legend but don`t know how to do this.
Thanks
Sonia
library(RColorBrewer)
par(mfrow=c(1,1))
nivel<-cut(CIU_T,5)
par(pty="m")
nParts<-as.numeric(nivel)
mypalette<-brewer.pal(7,"YlOrRd")
fgs<-mypalette[nParts]
plot(zrp_ov,fg=fgs,xlab="",ylab="",xaxt="n",yaxt="n",bty="n",ol="grey")
brks<-attributes(nivel)$levels
legend("topleft",legend=brks,fill=mypalette,bty="n",cex=.8,title="CIU_T",inset=0)
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo