Effacer les filtres
Effacer les filtres

display the maximum value of a dynamically updated colorbar

13 vues (au cours des 30 derniers jours)
Katherinie Zheng
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.

Réponse acceptée

KSSV
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
  1 commentaire
Katherinie Zheng
Katherinie Zheng le 16 Juil 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

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by