0

我正在使用下面的代码来显示 3 个数字的一​​个条形。我在问是否有人可以帮助我使酒吧水平而不是垂直?因此,条形图在右端垂直,我希望它在底部水平,从第一个图到最后一个图。

这是我正在使用的代码:

ax(1)=subplot(1,3,1);
ax(2)=subplot(1,3,2);
ax(3)=subplot(1,3,3);
h=colorbar;
set(h, 'Position', [.9 .11 .05 .8150]);
for i=1:3
pos=get(ax(i), 'Position');
set(ax(i), 'Position', [pos(1) pos(2) 0.8*pos(3) pos(4)]);
end;
4

1 回答 1

2

我能够使用以下方法解决它:

h=colorbar('SouthOutside');
set(h, 'Position', [.1 .05 .8150 .05]);
for i=1:3
pos=get(ax(i), 'Position');
set(ax(i), 'Position', [pos(1) 0.1+pos(2) pos(3) 0.8*pos(4)]);
end;
于 2013-04-23T03:07:21.190 回答