matplotlib / cmocean

Colormap setup for standardizing commonly-plotting oceanographic variables.
MIT License
230 stars 52 forks source link

Update cm.py to register maps with matplotlib #67

Closed bastorer closed 6 years ago

bastorer commented 6 years ago

This commit checks if matplotlib is available and, if it is, registers the colour maps.

Each map is available via 'cmocean_', so that 'thermal' would be accessed, for example, by plt.pcolormesh(x, y, z, cmap = 'cmocean_thermal').

Alpha channels were also explicitly added and set to 1 (for the matplotlib-registered maps only)

This merge will resolve issue #61

kthyng commented 6 years ago

This looks great! I made a few changes:

Thanks so much for your contribution!