【问题标题】:Change window size of a plot in MatLab [duplicate]在 MatLab 中更改绘图的窗口大小 [重复]
【发布时间】:2017-06-23 04:47:36
【问题描述】:

我已经绘制了一个图表,我需要更改绘图窗口的窗口大小。请帮忙。

x=0:0.1:3;

for i = 1:4
    y0=[-0.05;-0.1;0.05;0.1];

y=y0(i,1)*exp(-2*x);
plot(x,y)
hold all
end

【问题讨论】:

    标签: matlab graph window size


    【解决方案1】:

    在循环之前,创建一个图形并将位置设置为 [startX, startY, width, height]

    x=0:0.1:3;
    figure('Position',[100 100 500 500]);
    for i = 1:4
        y0=[-0.05;-0.1;0.05;0.1];
        y=y0(i,1)*exp(-2*x);
        plot(x,y)
        hold all
    end
    

    或者,在您的原始代码之后,运行

    f = gcf;
    f.Position = [100 100 500 500]
    

    【讨论】:

      猜你喜欢
      • 2015-07-03
      • 2016-03-23
      • 2011-01-22
      • 1970-01-01
      • 1970-01-01
      • 2011-06-08
      • 1970-01-01
      • 1970-01-01
      • 2021-02-26
      相关资源
      最近更新 更多