display the maximum value of a dynamically updated colorbar

3 次查看(过去 30 天)
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.

采纳的回答

KSSV
KSSV 2021-7-16
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 个评论
Katherinie Zheng
Katherinie Zheng 2021-7-16
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by