AdvancedColormap

버전 1.0.0.0 (14.3 KB) 작성자: Andriy Nych
Performs advaced colormap operations
다운로드 수: 2.7K
업데이트 날짜: 2013/5/1

라이선스 보기

ADVANCEDCOLORMAP Performs advaced colormap operations

cmap = AdvancedColormap;
Returns current colormap, much like COLORMAP does,
but new figure is not created

cmaps = AdvancedColormap('GetSupportedColormaps')
Returns cell array of strings of all predefined colormaps.

AdvancedColormap('ShowSupportedColormaps')
AdvancedColormap('ShowSupportedColormaps','OnBlack')
AdvancedColormap('ShowSupportedColormaps','OnWhite')
Displays all predefined colormaps as a color+grayscale image
or white (default) or black background.
img = AdvancedColormap('ShowSupportedColormaps',...)
The image is returned if output parameter is specified.

str = AdvancedColormap('GetCurrentColormapString')
Returns current colormap string.
May not work properly if colormap was modified with commands below.

AdvancedColormap('Reverse')
AdvancedColormap('Invert')
AdvancedColormap('ShiftUp')
AdvancedColormap('ShiftDown')
AdvancedColormap('RGB>RBG')
AdvancedColormap('RGB>BRG')
AdvancedColormap('RGB>GRB')
AdvancedColormap('RGB>BGR')
AdvancedColormap('RGB>GBR')
AdvancedColormap('Brighten')
AdvancedColormap('Brighten',Amount)
AdvancedColormap('Darken')
AdvancedColormap('Darken',Amount)
Performs advanced command on current colormap.

AdvancedColormap('MakeUniformByGrayValue')
Tries to adjust current colormap so its gray values grow linearly.

AdvancedColormap(MatLabColorMapName)
AdvancedColormap(MatLabColorMapName,Length)
This is equivalent to MatLab
colormap(cmap)
and
colormap(cmap,n)
respectively.

AdvancedColormap(ColorMapString)
AdvancedColormap(ColorMapString,Length)
AdvancedColormap(ColorMapString,Length,ColorPositions)
AdvancedColormap(ColorMapString,Length,ColorPositions,InterpolationMode)

ColorMapString String representation of colormap
Each character represents one color
and must belong to the following set

char color R- G- B- values
k black 0.0 0.0 0.0
r red 1.0 0.0 0.0
p pink 1.0 0.0 0.5
o orange 1.0 0.5 0.0
g green 0.0 1.0 0.0
l lime 0.5 1.0 0.0
a aquamarine 0.0 1.0 0.5
b blue 0.0 0.0 1.0
s sky blue 0.0 0.5 1.0
v violet 0.5 0.0 1.0
c cyan 0.0 1.0 1.0
m magenta 1.0 0.0 1.0
y yellow 1.0 1.0 0.0
w white 1.0 1.0 1.0

If the string does not contain spaces, each
character represents one color in colormap.
For example, 'kryw' defines black-red-yellow-white (hot-like) colormap
If string contains spaces then each group of space-delimited characters
define one color. RGB components of the color are formed
by averagin of RGB components of each color from the group.
For example, 'bw k rw' defines lightblue-black-lightred colormap

Colors in the generated colormap are evenly spaced
covering values from 0 to 1

Length Length of generated colormap

ColorPositions Vector of color positions
If colors from the ColorMapString should be
placed at custom data values, provide their positions in this vector.
Length of the ColorPositions should be equal
to length of the ColorMapString if ColorMapString does not contain spaces
or to number of color groups in ColorMapString

InterpolationMode 'nearest' {'linear'} 'spline' 'cubic'
Interpolation mode for colormap
See INTERP2 for details

cmap = AdvancedColormap(ColorMapString,...)
ADVANCEDCOLORMAP returns applied colormap to caller

ctable = AdvancedColormap(ColorMapString,0);
[ctable,cpos] = AdvancedColormap(ColorMapString,0);
When requested length of colormap is zero, ADVANCEDCOLORMAP returns
original table of colors used to generate the colormap in CTABLE.
This can be applied only for predefined or generated-on-the-fly colormaps.
ADVANCEDCOLORMAP also returns vector CPOS of positions of the colors returned in CTABLE

Examples
By inverting and reversing standard BONE colormap one can obtain nice sepia colormap

figure;
imagesc(peaks(256));
AdvancedColormap('bone');
AdvancedColormap('invert');
AdvancedColormap('reverse');

figure;
imagesc(peaks(256));
AdvancedColormap('kryw');

See ADVANCEDCOLORMAPDEMO scropt for more examples

See also colormap, brighten, FEX#23342, FEX#23865, FEX#24870, FEX#20848

인용 양식

Andriy Nych (2024). AdvancedColormap (https://www.mathworks.com/matlabcentral/fileexchange/41583-advancedcolormap), MATLAB Central File Exchange. 검색 날짜: .

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

도움 받은 파일: real2rgb & colormaps

도움 준 파일: Academic Figures, rgbmap color maps

Community Treasure Hunt

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

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