MATLAB Answers


How to define paper orientation in export_fig for pdfs

Asked by Aleg
on 13 Nov 2012

I try to create a pdf file with a figure and it always creates file with landscape orientation. No matter what parameters I put in place. Code example:

figure('PaperSize',[20.98404194812 29.67743169791]); plot(AvgIndustryLP(1:end,1),'-g'); set(gcf, 'Color', 'w'); export_fig ('PaperOrientation','portrait','test.pdf')

Does any one know how to define paper orientation for pdfs in export_fig?



Jan Simon
on 13 Nov 2012

Please ask the author.

Oliver Woodford
on 23 Nov 2012

Please don't ask the author.


No products are associated with this question.

1 Answer

Answer by Oliver Woodford
on 23 Nov 2012

The export_fig submission description, help text and the web page all clearly state that the figure is saved as it appears on screen. Therefore if you want to save a figure in landscape, make it landscape on screen. E.g.

figure('Position', [100 100 500 300]);
export_fig test.pdf

The PaperSize property you set is ignored by export_fig, and export_fig has no PaperOrientation option.


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!