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.
0 个评论
采纳的回答
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!