Azzera filtri
Azzera filtri

display the maximum value of a dynamically updated colorbar

13 visualizzazioni (ultimi 30 giorni)
Hi
I have a dynamically updated color bar, and I want the color bar always display its maximum value and minimum value no matter how they changes. How can I achieve it?
Thank you so much for your attention.

Risposta accettata

KSSV
KSSV il 16 Lug 2021
for i = 1:10
Z = peaks(100)*rand ;
pcolor(Z) ;
h = colorbar ;
val0 = min(Z(:)) ;
val1 = max(Z(:)) ;
h.Label.String = sprintf('min = %f, max = %f',val0,val1);
drawnow
end
  1 Commento
Katherinie Zheng
Katherinie Zheng il 16 Lug 2021
Thank you so much~~
Is there any way that I can change the orientation of the lable? Currently is wrting from bottom to up. I would like to read them from top to the bottom

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by