There are some relevant—and beautiful—colormaps (hereafter cmaps) which are not available built-in in Matplotlib, namely the following ones:
- Turbo: a cmap recently developed by the Google AI team which improves on the infamous jet cmap
- Parula: the default cmap in MATLAB
- Mathematica’s default cmap
I really enjoy these cmaps, so I incorporated them into the nmmn package for convenient usage within Python when using Matplotlib routines for plotting images.
In order to use these cmaps in your work, it is really easy:
1. Install the nmmn package
Using the following command in the terminal
pip install nmmn
2. Once nmmn is installed, choose your preferred cmap.
import nmmn.plots
wolfram=nmmn.plots.wolframcmap() # for Mathematica's cmap
parula=nmmn.plots.parulacmap() # for MATLAB's cmap
turbo=nmmn.plots.turbocmap() # Turbo
3. Use them to plot an image
pcolormesh(x, y, z, cmap=turbo, vmin=z_min, vmax=z_max)
title("Turbo")
colorbar()
A Jupyter notebook illustrating and comparing the result of plotting different images with these cmaps is available. This notebook generates the comparison below.