[R-sig-Geo] How to change scale labeling in spplot

Tim Salabim t|m@@ppe|h@n@ @end|ng |rom gm@||@com
Mon Aug 10 22:34:36 CEST 2020


Have you tried
colorkey=list(labels = list(labels = list("Af","Am","Aw")))
?



On Mon, Aug 10, 2020, 22:01 Thomas Adams <tea3rd using gmail.com> wrote:

> Hi all,
>
> I have searched for examples to change the labeling for raster data (two
> panels) consisting of integer values (1, 2, and 3). In the scale I want to
> label these as "Af", "Am", Aw".
>
> My code looks like:
>
> colp <- colorRampPalette(c("#960000", "#FF0000", "#FFCCCC"))
> brks<-seq(0,3,1)
>
> spplot(KG_haiti,xlim=c(-8313027,-7959668),ylim=c(2017552,2297053),at=brks,col.regions=colp(length(brks)-1),ylab="Climate
> Class",main="Koppen-Geiger Climate Classification for\nClimate Years
> 1981-2010 and El Nino Years",names.attr=c("Climate Normal","El
> Nino"),colorkey=list(labels = list(labels = c("Af","Am","Aw"))))
>
> I'm getting just the 3 colors, but the labels "Af", "Am", Aw" are repeated
> across each color; I need to have each color associated with just one of
> the labels. Obviously, I'm doing something wrong...
>
> I just cannot figure out how to do this.
>
> Regards,
> Tom
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list