color_shades: Create custom colormaps using any colors!

버전 1.0.0 (1.5 KB) 작성자: Gonzalo Ferrada
color_shades allows you to easily create custom colormaps using different colors from the rgb function (link in the description).
다운로드 수: 210
업데이트 날짜: 2019/4/5

라이선스 보기

Create your custom colormap using the listed colors within the rgb function (required; download from https://www.mathworks.com/matlabcentral/fileexchange/24497-rgb-triple-of-color-name-version-2).

Example 1: Use a colormap going from green, to yellow, to red, to violet just execute:

my_colormap1 = color_shades({'green','yellow','red','violet'});

Now, let's use it plotting some data:

peaks
colormap(my_colormap1)
colorbar

The result is showed in the image of this function.

Example 2 : Replicate a colormap used in colored infrared satellite images:

my_colormap2 = color_shades({'black','gray','white','steelblue','green','yellow','orange','darkred','pink'});

Using it when plotting satellite or model data you will get something like showed in Example 2 (see figure).

Example 3 : Create a colormap for displaying wind speed from model data:

wind_colors = {'white','azure','turquoise','yellow','orangered','Pink','white'};
my_colormap3 = color_shades(wind_colors);

See figure example 3 to see the result when creating a plot of wind using model data.

Notes:
- You can use whichever number of colors you want. Just be sure of following the syntax of the examples to avoid errors.
- To see the full list of color names, execute rgb chart.
- Function does not support any other input than a cell string.
- Be creative!

인용 양식

Gonzalo Ferrada (2025). color_shades: Create custom colormaps using any colors! (https://www.mathworks.com/matlabcentral/fileexchange/71121-color_shades-create-custom-colormaps-using-any-colors), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2017a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Blue에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0