I want to export a figure but with 50% smaller Width and height
3 次查看(过去 30 天)
显示 更早的评论
Hello all,
I saved my figure using the following code
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0, 0.04, 1, 0.96]); % Enlarge figure to full screen.
export_fig('F:\Farvardin 99 Codes\Subbasins\precipitation\figures\wintersubbasin1', '-dpng','-transparent', '-r900');
But the generated photo is really big and when I paste it to A4 paper in Microsoft office word I saw a small font size and LineWidth
In addition, I want to have 2 of this figure beside each other in a row; So I want to save it with smaller Width and height, like this:
I want to have the figure still in high quality. Please help me with this issue.
Really thank you
0 个评论
采纳的回答
Johannes Hougaard
2020-4-20
Hi Behzad,
I think that rather than using the
set(gcf,'Units','Normalized','OuterPosition', [0, 0.04, 1, 0.96])
you should use the PaperUnits and PaperPosition properties. Keeping the -r900 option will retain the high resolution of the picture.
figure; plot(x,y);
xlabel('x-axis label');
ylabel('y-axis label');
legend('legend1','legend2','legend3','legend4');
set(gcf,'PaperOrientation','landscape');
set(gcf,'PaperUnits','normalized')
set(gcf,'PaperPosition',[0 0 1 1]); % change this to e.g. [0 0 0.5 0.5] or [0 0 0.25 0.5] to get the desired outputs
print(gcf,filename,'-dpng','-r900');
set(gcf,'WindowState','maximize') % if you still wish to maximize your window this is preferred in R2020a
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!