daltonize

Version 1.0.0 (1.35 KB) by phenan08
Automatic colormap adjustment for color-blind users.
10 Downloads
Updated 3 Dec 2023

View License

This function automatically converts any colormap supplied as an argument into a color-blind-friendly colormap, by adjusting color saturation.
Example of use:
N = 5 ;
colors = parula(N) ;
x = [1:5]' ;
figure("Position",[100 100 400 300]) ;
for i = 1:N
plot(x,i*x,"-o","Color",colors(i,:),"LineWidth",2,"MarkerFaceColor",colors(i,:)) ;
hold on ;
end
hold off ;
title("Figure with original parula colormap") ;
colors2 = daltonize(parula(N)) ;
figure("Position",[100 100 400 300]) ;
for i = 1:N
plot(x,i*x,"-o","Color",colors2(i,:),"LineWidth",2,"MarkerFaceColor",colors2(i,:)) ;
hold on ;
end
hold off ;
title("Figure with adjusted parula colormap") ;

Cite As

phenan08 (2024). daltonize (https://www.mathworks.com/matlabcentral/fileexchange/155929-daltonize), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2023b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0