ColorBlindSets

Helps you choose a palette of color blind friendly colors
ダウンロード: 233
更新 2017/11/23

ライセンスの表示

GETCOLORSET : Color Blind Friendly Color Sets
[ cMat, cStruct, cNames, colorCell] = getColorSet( NColors , PaletteSize, skipGray)
Helps you choose a palette of color blind friendly colors
The palette choice is such as to attempt best discriminability by a deuteranopus
color blind as long as PaletteSize(PaletteSize) <= 14
1) assigns colors to [cMat, cStruct]
2) sets defaultAxesColorOrder accordingly for use with hold all
3) Returns a list [ cNames, colorCel] of NColors,
where PaletteSize colors are repeated to fill up required NColors size
NColors : size(cMat,1) = numel(cNames) --> number of curves that will be plotted on top
PaletteSize : how many different colors are there

PaletteSize : 1..27
----------
<= 11 Color Blind Safe % SMALL
12..15 Color Blind okeish % MEDIUM
16..19 Color Blind challenging % LARGE
20..26 Color Blind unfriendly % Too Large

Four possible color addressing modes :
------------------------------------
(1) automatic
hold all; plot(..); Use defaultAxesColorOrder colors, set by this function

(2) cell Array
plot( ,'color', colorCell{idx}) Cell Array

(3) matrix row
plot(...,'color', cMat(idx,:)) Matrix Row

(4) struct name with color name field
plot(...,'color', cStruct.SpringGreen) Color Name

EXAMPLE, Using Defaults
=======
N = 15; %number of curves
[ cMat, cStruct] = getColorSet(); %use best defaults for color blind viewer
figure(123); hold all;
for idx = 1:N
plot([0,1],N+1-[idx,idx], 'linewidth',6)
end
EXAMPLE
=======
N = 10;
[ cMat, cStruct, cNames] = getColorSet(N);
figure(123); hold on;
for idx = 1:N
plot([0,1],[idx,idx],'color',colorCell{idx}, 'DisplayName',cNames{idx}, 'linewidth',6)
end
leg = legend(gca,'-DynamicLegend');
legend(gca,'show');

引用

Massimo Ciacci (2024). ColorBlindSets (https://www.mathworks.com/matlabcentral/fileexchange/65163-colorblindsets), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2014b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersRegion and Image Properties についてさらに検索
タグ タグを追加

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0