Filter löschen
Filter löschen

display the maximum value of a dynamically updated colorbar

13 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

KSSV
KSSV am 16 Jul. 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 Kommentar
Katherinie Zheng
Katherinie Zheng am 16 Jul. 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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by