如何在MATLAB图中将colorbar的最大值显示为“> x”?

问题描述 投票:1回答:1

我正在绘制一个空间图,我在colormap中显示从0到20的值。

这就是我在做的事情,

caxis([0 20])    
h = colorbar('Fontsize', 4, 'LineWidth', 0.15);

下面是生成的颜色条,

enter image description here

因为,很少有值大于20,我想在colorbar中显示最大的刻度值为>20而不是20

怎么做?

matlab matlab-figure colorbar colormap
1个回答
5
投票

只需在代码后添加:

h.TickLabels{end} = '>20';

或更一般地说:

h.TickLabels{end} = ['>' h.TickLabels{end}];
© www.soinside.com 2019 - 2024. All rights reserved.