How to export figures as pdf without truncated borders.
116 次查看(过去 30 天)
显示 更早的评论
Update:
There is a solution now since 2019a and Save As will soon behave the same.
After filing a bug report (thanks Alex!) I got the following helpful eMail:
-----------------
Hello Frieder,
I am writing in reference to your Technical Support Case #03813750 regarding 'msaximizing plot in MS Windows and saving as pdf truncates'.
Starting with 19a you can use the axes toolbar for PDF export without cropping.
![unnamed.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/241466/unnamed.png)
I logged an enhancement to make SaveAs behave the same.
Further when using SaveAs you should also get a warning in MATLAB in the case things will get cut off including stating how to workaround:
Warning: The figure is too large for the page and will be cut off. Resize the figure, adjust the
output size by setting the figure's PaperPosition property, use the 'print' command with either the
'-bestfit' or '-fillpage' options, or use the 'Best fit' or 'Fill page' options on the 'Print
Preview' window.
----------------------
orginal post:
I plot a figure, enlarge it, select File -> Save As and choose pdf as output format and the resulting PDF it is truncated left and right.
I've been using MATLAB for 10 years and this has been a constant annoyance.
Yes, I can use export_fig etc. but such a basic default future being buggy all those years is just frustrating.
In my opinion this needs to be put to the top of Mathworks priority list.
回答(2 个)
Alex Pedcenko
2019-9-27
This seems to happen when you are saving "maximized plot" window to PDF. MATLAB tries to fit figure into portrait page layout (when your figure in maximized window is more like "landscape"-like.
If you want to avoid "trim", make figure window smaller (e.g. "unmaximize" it), then PDF export does not seem to trim it (at least for me, R2017a).
Alex
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!