【问题标题】:Color bar positioning in MatlabMatlab中的颜色条定位
【发布时间】:2013-04-23 02:56:30
【问题描述】:

我正在使用下面的代码来显示 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;

【问题讨论】:

    标签: matlab matlab-figure


    【解决方案1】:

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

    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;
    

    【讨论】:

    猜你喜欢
    • 2012-10-29
    • 2021-05-14
    • 1970-01-01
    • 2020-10-19
    • 1970-01-01
    • 2013-08-15
    • 1970-01-01
    • 1970-01-01
    • 2017-03-22
    相关资源
    最近更新 更多