打印Matlab绘图:如何减少灰色边框?

打印Matlab绘图:如何减少灰色边框?,matlab,plot,border,Matlab,Plot,Border,此块创建两个子图,然后将结果图打印到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'); 生成的绘图具有较大的灰色边框。我希望它们尽可能小,子地块尽可能详细。我如何才能做到这一点?您可以使用设置的子

此块创建两个子图,然后将结果图打印到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');

生成的绘图具有较大的灰色边框。我希望它们尽可能小,子地块尽可能详细。我如何才能做到这一点?

您可以使用设置的子批次位置。我写下了一些数字,但它们没有优化。我鼓励你玩数字游戏,以填补你想要的数字

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;
这有用吗?