With levelplot
/spplot
we can use at
to define the color region range (min, max, interval). My question is: how can I use red for values greater than 29.5?
This is my sample NCDF file --> download here
library (raster)
r <- brick('bali.nc', varname='TEMPERATURE', level=1)
library(rasterVis)
jet <- colorRampPalette(
c('#00007F', 'blue', '#007FFF', 'cyan', 'yellow', '#FF7F00', 'red', '#7F0000')
)
# First Figure - without at
levelplot(r, layer=1, margin=F, contour=F, col.regions=jet)
# Second Figure - with at
levelplot(r, layer=1, margin=F, contour=F, col.regions=jet, at=seq(27.5, 29.5, 0.1))