-
import leafmap
import leafmap.colormaps as cm
from matplotlib.colors import ListedColormap
cols = cm.get_palette('OrRd_r')
cmap = ListedColormap(cols)
m = leafmap.Map(center=(30.46001618003947, 114.61223316513498), zoom=11)
f_urban = "./Wuhan_Urban_GAIA_120D/urban_perc_2018.tif"
# cols = cm.palettes.OrRd_r.default
# cols
m.add_raster(f_urban, cmap=cmap, vmin=0, vmax=1, layer_name='perc_urban')
m
|
Beta Was this translation helpful? Give feedback.
Answered by
giswqs
Oct 17, 2023
Replies: 1 comment 5 replies
-
The m.add_raster(dem, cmap='OrRd_r', layer_name="DEM")
m.add_raster(dem, cmap=['#ff0000', '#ffff00', '#0000ff'], layer_name="DEM2") |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
giswqs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
cmap
parameter accepts a matplotlib colormap0 string or a list of hex color codes.