display the maximum value of a dynamically updated colorbar
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Katherinie Zheng
am 16 Jul. 2021
Kommentiert: Katherinie Zheng
am 16 Jul. 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 Kommentare
Akzeptierte Antwort
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Colorbar finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!