How can I reverse colormap in contourfm?

40 visualizaciones (últimos 30 días)
Aleksandra
Aleksandra el 26 de Nov. de 2012
Respondida: Tony Azar el 1 de Jun. de 2022
I'd like to use the reverse of jet colormap in contourfm. contourfm seems to only accept standard string values for predefined colormaps.

Respuesta aceptada

Walter Roberson
Walter Roberson el 26 de Nov. de 2012
?? 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 comentarios
M.Prasanna kumar
M.Prasanna kumar el 3 de Nov. de 2019
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 el 26 de Mayo de 2022
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"

Iniciar sesión para comentar.

Más respuestas (1)

Tony Azar
Tony Azar el 1 de Jun. de 2022
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"

Categorías

Más información sobre Mapping Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by