R how to control spacing of colour bar/legend
I'd like to plot a map of chlorophyll concentration, but the values are dispersed in such a way that the legend becomes unreadable (see picture) So I am trying to control the spacing of the colours in the colour bar/legend. I'd like to get it evenly spaced (while keeping the uneven breaks on the map itself). The the example below is much simplified and is for a raster plot, but the same goes for image.plot. library(raster) r <- raster(ncol=5, nrow=4) r[] <- 1:20 plot(r, breaks = c(0,1,2,3,5,10,20), col = rainbow(6)) I thought about converting the data to log values, but that doesn't give me a