Printing the figure to PDF in vector format and not bitmap

17 次查看(过去 30 天)
Hi all,
I am trying to print the figure into the PDF format. I have already set the renderer to Painters by:
fig1=figure(1)
fig1.Renderer='Painters'
but when I print the figure into PDF it still in bitmap and not vector. Anybody can assist me with the issue, please?

回答(1 个)

Yash
Yash 2024-11-10,19:06
Hello Aleksey,
To print a figure to a PDF in vector format, please consider the following suggestions:
1. Specify the graphics renderer as '-vector' while using the 'print' function as detailed in the documentation here: https://www.mathworks.com/help/matlab/ref/print.html#bukyb6e-1-renderer
2. Call the exportgraphics function. Specify an .eps, .pdf, or .emf file extension and set the 'ContentType' option to 'vector'. This function captures content that is tightly cropped around plots, and it does not create full-page output. For example, create a plot and save the contents of the current figure as a PDF file containing vector graphics.
plot([0 3 2 4 1]);
exportgraphics(gcf,"myplot.pdf","ContentType","vector")
3. Consider using this function available on File Exchange SaveFigure: Matlab vector figure export
I hope this accomplishes your task.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by