colormaplist
설명
cmaps = colormaplist는 사용 가능한 컬러맵 목록을 m×1 string형 배열로 반환합니다.
예제
컬러맵 목록을 반환합니다.
cmaps = colormaplist
cmaps =
21×1 string array
"parula"
"turbo"
"hsv"
"hot"
"cool"
"spring"
"summer"
"autumn"
"winter"
"gray"
...특정 컬러맵에 정의된 RGB 3색을 반환하는 함수를 만듭니다.
컬러맵 목록을 반환합니다.
cmaps = colormaplist
cmaps =
21×1 string array
"parula"
"turbo"
"hsv"
"hot"
"cool"
"spring"
"summer"
"autumn"
"winter"
"gray"
...str2func를 사용하여 turbo 컬러맵의 처음 n개의 RGB 3색을 반환하는 함수를 정의합니다.
cmapFcn = str2func(cmaps(2))
cmapFcn =
function_handle with value:
@turbocmapFcn을 사용하여 turbo의 처음 5개의 RGB 3색을 나열합니다.
cmapFcn(5)
ans =
0.1900 0.0718 0.2322
0.1602 0.7332 0.9252
0.6384 0.9910 0.2365
0.9853 0.5018 0.1324
0.4796 0.0158 0.0106plotwithcolormaps 함수는 axes 객체를 만들고 좌표축에 곡면을 플로팅합니다. 또한 이 함수는 목록 상자도 만들고 colormaplist를 호출한 결과를 사용하여 목록을 채웁니다.
function plotwithcolormaps f = uifigure; ax = axes(f,Units="pixels",Position=[180 100 500 400]); cmaps = colormaplist; uilistbox(f,Position=[750 200 120 320],Items=cmaps,... ValueChangedFcn=@applycmap); surf(ax,peaks) function applycmap(src,~) colormap(src.Parent,src.Value) end end
plotwithcolormaps를 저장하고 실행합니다. 목록 상자에서 옵션을 선택하여 그래프의 컬러맵을 변경합니다.
plotwithcolormaps

버전 내역
R2025a에 개발됨
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)