display the maximum value of a dynamically updated colorbar
10 views (last 30 days)
Show older comments
Katherinie Zheng
on 16 Jul 2021
Commented: Katherinie Zheng
on 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 Comments
Accepted Answer
KSSV
on 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
More Answers (0)
See Also
Categories
Find more on Colorbar in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!