Effacer les filtres
Effacer les filtres

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

5 vues (au cours des 30 derniers jours)
BN
BN le 19 Avr 2020
Commenté : BN le 20 Avr 2020
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

Réponse acceptée

Johannes Hougaard
Johannes Hougaard le 20 Avr 2020
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

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Tags

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by