MatPlotLib Perceptually Uniform Colormaps

버전 2.1.4 (735 KB) 작성자: Stephen23
MatPlotLib's default perceptually uniform colormap VIRIDIS and distinctive line ColorOrder TAB10
다운로드 수: 5.5K
업데이트 날짜: 2024/1/10

라이선스 보기

From MatPlotLib 2 and 3:
  • the default sequential colormap VIRIDIS (as well as INFERNO, MAGMA, and PLASMA).
  • the default line colororder TAB10 (as well as TAB20, TAB20B, and TAB20C).
  • the perceptually uniform cyclic colormaps TWILIGHT and TWILIGHT_SHIFTED
  • 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:
The default MatPlotLib colormap was changed to the newly created VIRIDIS, replacing the awful JET/RAINBOW, and the default line colororder changed to VEGA10 (note that the VEGA# colormaps were renamed TAB# in MatPlotLib 3), as described here:
The data are taken from:
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
ssplot(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)

인용 양식

Stephen23 (2024). MatPlotLib Perceptually Uniform Colormaps (https://www.mathworks.com/matlabcentral/fileexchange/62729-matplotlib-perceptually-uniform-colormaps), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2010b
R2009b 이상 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음

버전 게시됨 릴리스 정보
2.1.4

* Documentation improvement.

2.1.3

* Update image aspect ratio

2.1.2

* Update image aspect ratio.

2.1.1

* Update image.

2.1.0

* Update to use HG2 default map length.
* Add TWILIGHT_SHIFTED

2.0.3

* Better overview image.

2.0.2

* Add error IDs.

2.0.1

Add YouTube link to description.

2.0.0

* Include colormaps CIVIDIS and TWILIGHT
* Rename VEGA* to TAB*, matching MatPlotLib 3

1.0.0.0

* Change blurb.
* Added image.