Setting the range of colormap

1 visualización (últimos 30 días)
Deepa Maheshvare
Deepa Maheshvare el 20 de En. de 2020
Comentada: Deepa Maheshvare el 20 de En. de 2020
I want to set the min and max range of colormap
I want to set the limits of colormap based on the mix and max of values stored in data
data = rand(10,10);
min = min(min(data))
max= max(max(data))
Any suggestions on how this can be done?

Respuestas (1)

Bhaskar R
Bhaskar R el 20 de En. de 2020
caxis([min(data(:)), max(data(:))]);
See more details
  3 comentarios
Image Analyst
Image Analyst el 20 de En. de 2020
That's because you clear your figure with clf right at the start of the loop! That clears everything including what you set up with caxis(). Don't call clf.
Deepa Maheshvare
Deepa Maheshvare el 20 de En. de 2020
Thank you. I removed clf, even now the color assignd to values change in each iteration

Iniciar sesión para comentar.

Categorías

Más información sobre Color and Styling en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by