필터 지우기
필터 지우기

How can I reverse colormap in contourfm?

조회 수: 23 (최근 30일)
Aleksandra
Aleksandra 2012년 11월 26일
답변: Tony Azar 2022년 6월 1일
I'd like to use the reverse of jet colormap in contourfm. contourfm seems to only accept standard string values for predefined colormaps.

채택된 답변

Walter Roberson
Walter Roberson 2012년 11월 26일
?? MATLAB's contourfm does not have a colormap argument at all, let alone a string.
If you want to reverse the colormap, just do it:
colormap(flipud(jet))
  댓글 수: 2
M.Prasanna kumar
M.Prasanna kumar 2019년 11월 3일
is there a way to assign yellow color to blue and blue to yellow in an image ??
im using imagesc command
i have attached my image
Tony Azar
Tony Azar 2022년 5월 26일
Here is an example on how to reverse colors:
C = [0 2 4 6; 8 10 12 14; 16 18 20 22];
imagesc(C), colormapeditor
once the editor is loaded, click on "Edit Size and Colorspace" then check "Reverse"

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Tony Azar
Tony Azar 2022년 6월 1일
Here is how you can reverse the "jet" colormap in contourfm.
This example is from :
[N,R] = egm96geoid;
load coastlines
worldmap('world')
levels = -120:20:100;
contourfm(N,R,levels,'LineStyle','none')
geoshow(coastlat,coastlon,'Color','k')
contourcbar
colormap('jet')
colormapeditor
once the editor is loaded, click on "Edit Size and Colorspace" then check "Reverse"

카테고리

Help CenterFile Exchange에서 Mapping Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by