Possible to set number of levels on colormap?
sophieclayton opened this issue · 2 comments
sophieclayton commented
Hopefully I'm not missing something obvious here. I often set the number of levels when using matplotlib colormaps:
cmap = plt.get_cmap('jet',10)
Is there a way to do this with the cmocean colormaps?
kthyng commented
Hi! You should be able to get this behavior with:
import cmocean
cmap = plt.get_cmap('cmo.thermal', 10)
since once you import cmocean, the colormaps are added to the matplotlib registry with the "cmo." prefix.
sophieclayton commented
Brilliant! Thanks @kthyng