Cartoee colorbar
In [ ]:
Copied!
import ee
import geemap
import geemap.cartoee as cartoee
import geemap.colormaps as cmp
%pylab inline
import ee
import geemap
import geemap.cartoee as cartoee
import geemap.colormaps as cmp
%pylab inline
In [ ]:
Copied!
geemap.ee_initialize()
geemap.ee_initialize()
In [ ]:
Copied!
# get an image
srtm = ee.Image("CGIAR/SRTM90_V4")
# get an image
srtm = ee.Image("CGIAR/SRTM90_V4")
In [ ]:
Copied!
palette = cmp.palettes.dem
palette = cmp.palettes.dem
In [ ]:
Copied!
region = [70, 15, 140, 60] # define bounding box to request data
vis = {'min': 0, 'max': 5000} # define visualization parameters for image
vis = {'palette': palette, 'min': 0.0, 'max': 6000.0, 'opacity': 1.0}
region = [70, 15, 140, 60] # define bounding box to request data
vis = {'min': 0, 'max': 5000} # define visualization parameters for image
vis = {'palette': palette, 'min': 0.0, 'max': 6000.0, 'opacity': 1.0}
In [ ]:
Copied!
fig = plt.figure(figsize=(15, 10))
# use cartoee to get a map
ax = cartoee.get_map(srtm, region=region, vis_params=vis)
# add a colorbar to the map using the visualization params we passed to the map
cartoee.add_colorbar(
ax,
vis,
loc="bottom",
label="Elevation",
orientation="horizontal",
posOpts=[0.25, 0.05, 0.5, 0.02],
)
# add gridlines to the map at a specified interval
cartoee.add_gridlines(ax, interval=[10, 10], linestyle=":")
# add coastlines using the cartopy api
ax.coastlines(color="red")
show()
fig = plt.figure(figsize=(15, 10))
# use cartoee to get a map
ax = cartoee.get_map(srtm, region=region, vis_params=vis)
# add a colorbar to the map using the visualization params we passed to the map
cartoee.add_colorbar(
ax,
vis,
loc="bottom",
label="Elevation",
orientation="horizontal",
posOpts=[0.25, 0.05, 0.5, 0.02],
)
# add gridlines to the map at a specified interval
cartoee.add_gridlines(ax, interval=[10, 10], linestyle=":")
# add coastlines using the cartopy api
ax.coastlines(color="red")
show()
In [ ]:
Copied!
Last update:
2022-06-27