-
Notifications
You must be signed in to change notification settings - Fork 7
colorbar 'cmap' error #5
Copy link
Copy link
Open
Description
This example from the documentation of cartoee gives an error when adding cmap for the colorbar (but works when using custom palette)
# get an earth engine image
srtm = ee.Image("CGIAR/SRTM90_V4")
# vis
visualization = {'min':-500,'max':3000,'bands':'elevation'}
bbox = [-180,-90,180,90]
# plot the map
ax = cee.getMap(srtm,cmap='terrain',
region=bbox,
visParams=visualization,
dims=1000)
# add a color bar using cartoee
cb = cee.addColorbar(ax,loc='right',
cmap='terrain',
visParams=visualization)
ax.coastlines()
TypeError Traceback (most recent call last)
in ()
14 cb = cee.addColorbar(ax,loc='right',
15 cmap='terrain',
---> 16 visParams=visualization)
17
18 ax.coastlines()
2 frames
/usr/local/lib/python3.7/dist-packages/matplotlib/cbook/init.py in _check_isinstance(_types, **kwargs)
2126 ", ".join(names[:-1]) + " or " + names[-1]
2127 if len(names) > 1 else names[0],
-> 2128 type_name(type(v))))
2129
2130
TypeError: 'cmap' must be an instance of matplotlib.colors.Colormap or None, not a str
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels