How can I save a PDF without margins

41 次查看(过去 30 天)
Dear all,
I think since Release 2019b there exists a new save as button, which can be accessed in a figure plot. It is possible to save the figure as a .pdf and it is perfectly cropped.
Although, if a figure is saved, using the command saveas(figure(1), 'name','pdf') the figure has a lot of white space and is not cropped well enough.
Is it possible to access the same "save as" functionality from the command line as seen in the attached picture?
Kind regards
Philipp

回答(3 个)

Sulaymon Eshkabilov
Hi,
you can try to use this option:
print('-fillpage','FillPageFigure','-dpdf')
good luck.

Philipp Kryenbühl
Philipp Kryenbühl 2019-10-14
Thank you very much for your help.
This doesn't work as intented, since it just scales my figure to an A4.
The nice thing of the button, described on the top, is that it creates a pdf with the format of the corresponding figure.
Kind regards

Pavel Snabl
Pavel Snabl 2023-9-20
Hi,
since the version 2020a there exists this command:
exportgraphics(obj,filename)
which I think does exactly what you are looking for.
Kind regards,
Pavel

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by