Matlab:在colorbar上方添加单位

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

enter image description here

我有一个关于如何在颜色条上方添加单位的问题。我的代码如下:

hc=colorbar;
xlabel(hc,'psi');

但是,它显示单位不在彩条之上。

matlab colorbar
3个回答
10
投票

xlabel(hc,'psi')替换title(hc,'psi')。所以代码变成了

hc=colorbar;
title(hc,'psi');

这给了

enter image description here


2
投票

您可以使用以下代码

title(colorbar,'psi','FontSize',24);

0
投票

这将显示颜色条右侧的标签:

h=colorbar();
ylabel(h,'units');
© www.soinside.com 2019 - 2024. All rights reserved.