Printing the figure to PDF in vector format and not bitmap
18 views (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
Yash
on 10 Nov 2024 at 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.
0 Comments
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!