matplotlib colormaps for matlab
Just a small utility to export colormaps directly from matplotlib in python and use them in matlab.
cmapnames=colormap_matplotlib('list'); % retrieve list of available colormap names
cmap=colormap_matplotlib('magma'); %retrieve a specific colormap
%example:
figure;
imagesc(rand(10));
colormap(colormap_matplotlib('magma'));
colorbar(gca);
By default, the following colormaps are available
(Generated by example.m)
Additional complementary versions (hue rotated by 180°) end in "_comp"
And additional "diverging" colormaps by combining original and "_comp_r", which end in "_compdiv"
And reversed versions ending in "_r", "_comp_r", or "_compdiv_r"
This list was generated using Python 3.9.13 and matplotlib 3.5.2. If your matplotlib has additional colormaps you would like to include, you can regenerate this file with:
python save_matplotlib_colormaps.py matplotlib_colormaps.mat