MATLAB: Printing Figure to PDF produces bitmap instead of vector

bitmappdfprintvector

Hi,
I've three figures that I save to a pdf for inclusion in my report. For this i user: print(h,'-dpdf',filename); where h is the handle of the figure. All figures are plotted with the plot command, although the first image is just a combination of lines. While the other two are actually scatterplots, but plotted with the plot command for speed. Now with the print command the first figure is correctly saved as a a vector image, while the other two are bitmaps.
How is this possible? And how can I prevent this/correct this?
Thanks,
ChoKamir

Best Answer

Check the 'Renderer' property of the figures: While figures drawn by the 'Painters' renderer are vector plots in the exported PDF, with 'OpenGL' and 'ZBuffer' the PDF contains bitmap pictures of the screen output.
Either you have defined the renderer manually, or it was set automatically by Matlab, if the 'RendererMode' of the figure is 'auto'.
Solution: Set the renderer manually to 'Painters'.