버전 (2.96 KB) 작성자: Jurgen
Apply color CLR to colormap entry pertaining to value VAL. Either scaled or indexed figure.
다운로드 수: 500
업데이트 날짜: 2013/4/29

라이선스 보기

Extension of zerocolor() for arbitrary color. Greater control over colormaps allows user to increase contrast for particular values.

% valcolor(VAL,CLR)
% Updates current figure's colormap so values VAL get color CLR.
% This includes values mapped to the same color as VAL.
% CLR is either a vector between 0-1, e.g. [.4 .2 .9] or
% a standard MATLAB color string shorthand, e.g. 'r'.
% Based on Clim and CDataMapping value of current axes and image.
% valcolor(H,VAL,CLR) uses figure handle H instead of current.
% cmap = valcolor(...)
% Returns modified cmap based on figure's colormap.
% Does not apply it to figure. Apply with colormap().
% cmap = valcolor(VAL,CLR,oldmap,clims)
% Outputs colored cmap based on input map and clims.
% May supply data instead of clims, gets [min max] to create clims.
% If clims = false, assumes indexed colormap.

im1 = imread('moon.tif'); %scaled
figure;imagesc(im1);axis off
valcolor(50,[1 0 0 ])
valcolor(200,[1 1 0 ])

im2 = load('clown'); %indexed
valcolor(0,[0 1 0]);
valcolor(40,[0 0 0]);
valcolor(60,[0 1 1]);

인용 양식

Jurgen (2024). Valcolor (, MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2008a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
Help CenterMATLAB Answers에서 Colormaps에 대해 자세히 알아보기

받음: custom colormap, Zerocolor

Community Treasure Hunt

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

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