Borrar filtros
Borrar filtros

colors change in array

1 visualización (últimos 30 días)
m_vdv
m_vdv el 20 de Mayo de 2018
Comentada: Image Analyst el 20 de Mayo de 2018
Hi everyone,
It's difficult to explain but I've got an image of an array with elements whose value changes by each iteration, and Matlab automatically changes the colors of the associated value. How can I set that e.g 3 keeps being red, 2 keeps being yellow... by each iteration without changing? Thanks in advance.

Respuestas (1)

Image Analyst
Image Analyst el 20 de Mayo de 2018
MATLAB is most likely changing it because you have code that tells it to change it. And since you haven't shared your code (yet) we can't really say what is causing the change. I don't even know what is being changed. Is it a colormap?
  3 comentarios
m_vdv
m_vdv el 20 de Mayo de 2018
I mean I've got a colorbar, not a colormap.
Image Analyst
Image Analyst el 20 de Mayo de 2018
A colorbar requires a colormap. Even if you call colorbar without calling colormap(), the colorbar is using a colormap. If you don't specify a colormap then the colormap being used will adjust to each image you display. If you want it to be constant despite changing the image then you will have to adjust caxis(), and possibly send in a colormap each time you change the image. See the documentation for caxis().

Iniciar sesión para comentar.

Categorías

Más información sobre Blue 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