From MatPlotLib 2 and 3:
* the default sequential colormap VIRIDIS (as well as INFERNO, MAGMA, and PLASMA).
* the default line color order TAB10 (as well as TAB20, TAB20B, and TAB20C).
* the perceptually uniform cyclic colormap TWILIGHT.
* the colorblind-friendly sequential colormap CIVIDIS.
For MatPlotLib 2.0 new perceptually uniform colormaps were generated in the CAM02-UCS colorspace. The process is described here:
https://www.youtube.com/watch?v=xAoljeRJ3lU
The default MatPlotLib colormap was changed to the newly created VIRIDIS, replacing the awful JET/RAINBOW, and the default line colororder changed to VEGA10 (renamed TAB10 in MatPlotLib 3). The colormap data is available here <https://bids.github.io/colormap/> and the line colororder data here <https://github.com/vega/vega/wiki/Scales#scale-range-literals>.
### COLORMAP Examples ###
%% Plot the scheme's RGB values:
rgbplot(viridis(256))
%% New colors for the COLORMAP example:
load spine
image(X)
colormap(viridis)
%% New colors for the SURF example:
[X,Y,Z] = peaks(30);
surfc(X,Y,Z)
colormap(viridis)
axis([-3,3,-3,3,-10,5])
### Axes ColorOrder Examples ###
%% PLOT using matrices:
N = 10;
axes('ColorOrder',tab10(N),'NextPlot','replacechildren')
X = linspace(0,pi*3,1000);
Y = bsxfun(@(x,n)n*sin(x+2*n*pi/N), X(:), 1:N);
plot(X,Y, 'linewidth',4)
%% PLOT in a loop:
N = 10;
set(0,'DefaultAxesColorOrder',tab10(N))
X = linspace(0,pi*3,1000);
Y = bsxfun(@(x,n)n*sin(x+2*n*pi/N), X(:), 1:N);
for n = 1:N
plot(X(:),Y(:,n), 'linewidth',4);
hold all
end
%% LINE using matrices:
N = 10;
set(0,'DefaultAxesColorOrder',tab10(N))
X = linspace(0,pi*3,1000);
Y = bsxfun(@(x,n)n*cos(x+2*n*pi/N), X(:), 1:N);
line(X(:),Y)
Stephen Cobeldick (2021). MatPlotLib Perceptually Uniform Colormaps (https://www.mathworks.com/matlabcentral/fileexchange/62729-matplotlib-perceptually-uniform-colormaps), MATLAB Central File Exchange. Retrieved .
Inspired by: colorGray, Light Bartlein Color Maps, Vivid Colormap, Perceptually improved colormaps, Generate maximally perceptually-distinct colors, Matlab colormaps as seen by color-blind users, cbrewer : colorbrewer schemes for Matlab, POLARMAP: Polarized colormap, Beautiful and distinguishable line colors + colormap, CubeHelix Colormap Generator: Beautiful and Versatile!, ColorBrewer: Attractive and Distinctive Colormaps, Color blind friendly colormap, Intuitive RGB color values from XKCD, rgbmap color maps, Convert between RGB and Color Names, jetwhite(Colours), hslcolormap, Perceptually uniform colormaps, gramm (complete data visualization toolbox, ggplot2/R-like), Cyclic color map, cmocean perceptually-uniform colormaps, cbrewer2
Inspired: PyColormap4Matlab
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Can you put this repo on Github?