rastervis

Relassify continuous raster data into binned classes with discrete colors

孤人 提交于 2019-12-04 06:18:31
I would like to: Reclassify the raster ras into nine classes using reclassify Provide a colorkey with values written beside each colour (see sample plot below). The colorkey should not be split, as in the sample plot, but rather shown as a single colour ramp with 9 colours. Display the data using levelplot function (this I can do) Thanks for your help. AEZ library(rasterVis) Please use these colors: col <- colorRampPalette(c("yellow4", "yellow", "orange", "red3", "darkred")) levelplot(reclassras, col.regions = col) Below is the dput of my raster layer: ras=new("RasterLayer" , file = new("