Printing the figure to PDF in vector format and not bitmap

18 visualizaciones (últimos 30 días)
Aleksey Dyskin
Aleksey Dyskin el 11 de Sept. de 2018
Respondida: Yash el 10 de Nov. de 2024 a las 19:06
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?

Respuestas (1)

Yash
Yash el 10 de Nov. de 2024 a las 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.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by