필터 지우기
필터 지우기

I want to export a figure but with 50% smaller Width and height

조회 수: 5 (최근 30일)
BN
BN 2020년 4월 19일
댓글: BN 2020년 4월 20일
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

채택된 답변

Johannes Hougaard
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 CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by