How do I save a colormap and use it for another figure?
37 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alex
el 31 de Mzo. de 2019
Comentada: Star Strider
el 2 de Abr. de 2019
I run a script and produce the following figure.
I use colormapeditor to adjust the scale (see colorbar near 0 and 1). When I do the same for another figure that has the same range of values (0 to 1) the colorbar is slightly different (0.7 is yellow in the top figure and greenish in the bottom figure):
How do I save the colormap from the first figure and apply it to another?
Thank you in advance for your help!
Best regards,
Alex
0 comentarios
Respuesta aceptada
Star Strider
el 31 de Mzo. de 2019
After you plot the first figure, use this get call:
cm = get(gca,'Colormap');
Note that the 'Colormap' (link) and the colorbar (link) object are not the same. If you want to save it and use it somewhere else, you can get its handle with:
c = colorbar;
Experiment to get the result you want.
8 comentarios
Star Strider
el 2 de Abr. de 2019
As always, my pleasure!
I learned something from figuring out the problem you were having, and the solution, as well.
Your comment reminds me of a poem posted to the Stanford University computer bulletin board in the late 1970s:
I really hate this damn machine.
I wish that they would sell it.
It won’t do what I want it to,
But only what I tell it!
Más respuestas (0)
Ver también
Categorías
Más información sobre Orange en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!