save figure in a certain size
古いコメントを表示
In the following figure:
data = rand(1,365);
subplot(121);
plot(1:365,data);
xlabel('label');
ylabel('label');
subplot(122);
plot(1:365,data);
xlabel('label');
ylabel('label');
How could I save this figure as a pdf where the dimensions of the figure i.e. including both subplots is 7.25 x 9.125 inches?
採用された回答
その他の回答 (2 件)
Azzi Abdelmalek
2012 年 9 月 4 日
編集済み: Azzi Abdelmalek
2012 年 9 月 4 日
%add this at the end of your code
set(gcf, 'PaperUnits', 'inches');
x_width=7.25 ;y_width=9.125
set(gcf, 'PaperPosition', [0 0 x_width y_width]); %
saveas(gcf,'fig1.pdf')
3 件のコメント
Thao Pham
2021 年 3 月 24 日
Thank you, that is super helpful
Khairy Elsayed
2022 年 1 月 9 日
Thank you. It works well.
Pavan Kumar
2022 年 10 月 29 日
Thanks!
Hej
2019 年 1 月 25 日
1 投票
Hi I had the same questions, but the figure I get comes with a background white box that fits with the dimension and my actual figure is smaller. How do I remove this white box and make sure my figure is saved in the prescribed dimension? Thanks
2 件のコメント
KAE
2019 年 7 月 9 日
I have this same problem for a large figure (20x24")
Pavan Kumar
2022 年 10 月 29 日
編集済み: Pavan Kumar
2022 年 10 月 29 日
An alternate solution is to save the figure as EPS instead of saving as PDF, which gets rid of the white space in my case
カテゴリ
ヘルプ センター および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!