Geographic Information Systems Asked on April 11, 2021
I’m trying to plot the histogram values with the same order as the color palette of a raster legend, passing the parameter legend.col.reverse = TRUE
reverses the legend but not the histogram, since I’m trying to plot elevation values, it’s desirable to put highest on top of the legend.
EDIT
I can achieve it by plotting the layer twice and passing alternately the legend and histogram, but that’s hacky.
library(tmap)
data("land")
tm_shape(land, ylim = c(14,30), xlim = c(-105, -90)) +
tm_raster("trees", palette = "Greens", title = "Percent Tree Cover", legend.reverse = T,
legend.hist = T) +
tm_layout(legend.bg.color = "white")
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP