display the maximum value of a dynamically updated colorbar
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Katherinie Zheng
il 16 Lug 2021
Commentato: Katherinie Zheng
il 16 Lug 2021
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.
0 Commenti
Risposta accettata
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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Colorbar in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!