【发布时间】:2014-08-14 09:23:06
【问题描述】:
假设:
x=1:10;
y=x.^2;
h(1)=subplot(3,1,1:2);
plot(x,y);
h(2)=subplot(3,1,3);
plot(x,y);
我想知道是否有任何方法可以使两个图的 y 轴方向具有相同的数据单元(例如,缩短上图的 y 轴,使其等于底部的 y 轴一)?
提前非常感谢您, 维尔纳
【问题讨论】:
假设:
x=1:10;
y=x.^2;
h(1)=subplot(3,1,1:2);
plot(x,y);
h(2)=subplot(3,1,3);
plot(x,y);
我想知道是否有任何方法可以使两个图的 y 轴方向具有相同的数据单元(例如,缩短上图的 y 轴,使其等于底部的 y 轴一)?
提前非常感谢您, 维尔纳
【问题讨论】:
正如 Dev-iL 已经指出的那样。示例代码可以是
x=1:10;
y=x.^2;%First Output
z=x.^1.5;%Another output
figure
h(1)=subplot(2,1,1);
plot(x,y);
grid 'on'
h(2)=subplot(2,1,2);
plot(x,z);
grid 'on'
linkaxes([h(2) h(1)],'y');
【讨论】: