library(raster)
library(viridis)
data(volcano)
volcanoR <- raster(volcano)
breakpoints <- c(94,100,120,140,160,180,185, 189, 195)
par(mfrow = c(1, 2))
plot(volcanoR, main = "1")
plot(volcanoR, breaks = breakpoints, col = viridis(length(breakpoints) -1), main = "2")
在图2中,您会看到图例标签彼此非常接近甚至重叠。有没有办法,我可以让它们不重叠,等间距如图1所示。