MATLAB Saving MATLAB Figures as PDFs: Issues & Solutions

  • Thread starter Thread starter NoobixCube
  • Start date Start date
  • Tags Tags
    Issues Matlab
AI Thread Summary
When saving figures as PDFs in MATLAB, issues arise with landscape images being cut off to fit a portrait page. The default behavior of MATLAB's PDF export is linked to the window size of the figure, which can lead to poor quality outputs, such as jagged edges. To improve the situation, users are advised to create a startup script that sets the default paper type to A4 and adjusts the paper units and position mode. This ensures that figures are appropriately scaled for better presentation. Additionally, saving figures as EPS before converting to PDF is recommended for higher quality results.
NoobixCube
Messages
154
Reaction score
0
Hey all,
after producing a fig. with matlab, I save it as a PDF. But upon opening the pdf it seems to cut the fig to a portrait page, when the figure is actually a landscape image. Any ideas?
For an idea of what's going on, see the attached file.
 

Attachments

Physics news on Phys.org
Yeah don't ever use matlab's save as "pdf", it's terrible.
Two things if you are still going to do it this way:
-When you save as .pdf, the image will be produced according to the window size of your figure
-Look at your graph's, notice how they're rugged and "jaggedy"? That's a flaw of matlab.

I know you're attaching these figures in a document so here's something you should definitely do:
Go into matlab.
Create a new script file.
Place the following commands in it:

format long
format compact
set(0, 'defaultFigurePaperType', 'A4')
set(0, 'defaultFigurePaperUnits', 'centimeters')
set(0, 'defaultFigurePaperPositionMode', 'auto')

Save the file as startup.m and save in directory:
...\Matlab\Toolbox\Local\
Now everytime Matlab starts and you produce a figure, it will scale the window and any saved file to an A4 standard where you can fit upto 2 figures on a page. (save as EPS always, and convert to pdf).
 

Similar threads

Replies
7
Views
15K
Replies
5
Views
4K
Replies
4
Views
3K
Replies
1
Views
2K
Replies
12
Views
3K
Replies
4
Views
3K
Replies
7
Views
4K
Back
Top