[R-sig-Geo] map legend

Edzer J. Pebesma e.pebesma at geo.uu.nl
Sat Jul 15 21:43:41 CEST 2006


Sonia, perhaps by

nivel <- cut(CIU_T ,seq(min(CIU_T),max(CIU_T),length=6))

hth,
--
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
>




More information about the R-sig-Geo mailing list