This repository provides minimalist RGB color definitions from Open Color, making it easy to use color themes when plotting graphics in MATLAB.
本仓库提供来自Open color 的简约 RGB 颜色定义,方便在MATLAB中使用绘制图形颜色主题。
Happy plotting! 🎉🎉🎉
Directly load the 'colormapData.mat' color theme data into your MATLAB workspace.
直接在你MATLAB工作空间中加载“colormapData.mat”颜色主题数据。
load colormapData.mat
Note
This contains a dictionary that includes all the color theme data, where each color is represented by a 256x3 color mapping array. The data range is [0,1].
d =
dictionary (string --> cell) with 13 entries:
"Gray" --> {256×3 double}
"Red" --> {256×3 double}
"Pink" --> {256×3 double}
"Grape" --> {256×3 double}
"Violet" --> {256×3 double}
"Indigo" --> {256×3 double}
"Blue" --> {256×3 double}
"Cyan" --> {256×3 double}
"Teal" --> {256×3 double}
"Green" --> {256×3 double}
"Lime" --> {256×3 double}
"Yellow" --> {256×3 double}
"Orange" --> {256×3 double}
- MATLAB R2022b or later
Create a matrix of data. Then create a heatmap of the matrix values, draw the theme colors one by one.
创建一个数据矩阵,然后绘制矩阵值的热图,一个一个地绘制主题颜色。
load colormapData.mat
cdata = rand(10);
keyNames = keys(d);
for idx = 1:numEntries(d)
figure;
heatmap(cdata);
cmap = d(keyNames(idx));
colormap(cmap{:})
title("Color Theme:"+keyNames(idx));
end