0

此块创建两个子图,然后将生成的图打印到 TIF 文件中:

h = figure;
subplot(1,2,1);
plot(rand(5,1));
legend('1st legend');
subplot(1,2,2);
plot(rand(5,1));
legend('2nd legend');
drawnow;
print(h,'-dtiff','-r300','plot.tif');

生成的图有大的灰色边框。我希望它们尽可能小,并且子图尽可能详细。我怎样才能做到这一点?

4

1 回答 1

0

您可以使用设置的子图位置。我写下了一些数字,但它们没有优化。我鼓励你用数字来填充你想要的数字。

h = figure;
subplot(1,2,1);
plot(rand(5,1));
legend('1st legend');
set(subplot(1, 2, 1), 'Position', [0.07, 0.07, 0.40, 0.90])
subplot(1,2,2);
plot(rand(5,1));
legend('2nd legend');
set(subplot(1, 2, 2), 'Position', [0.50, 0.07, 0.40, 0.90])
drawnow;
于 2013-06-06T13:07:27.233 回答