display the maximum value of a dynamically updated colorbar
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Katherinie Zheng
le 16 Juil 2021
Commenté : Katherinie Zheng
le 16 Juil 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 commentaires
Réponse acceptée
KSSV
le 16 Juil 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
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Colorbar dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!