I want to draw some basic surfaces, export them to PDF and include them in a LaTeX file. I create a simple 3D graphics object, for instance with
ParametricPlot3D[{r Cos[θ], r Sin[θ], r^2}, {r, 0, 1}, {θ, 0, 2 π}]
then context-click on the graphics and select Save Graphic As ..., and save it as PDF.
The resulting PDF is 5MB large! When I include it in my LaTeX file it takes a long time to compile and to render in a PDF viewer.
I know that I can save it in another format such as PNG to get the file size down (in this case all the way to 33KB). But I'd prefer a vector format because my final product will be PDF. Are there some options to the Export[]
command which might reduce the number of colors and make the exported file smaller?
Answer
My preferred method to export graphics to pdf is to do something like
Export["figure.pdf", plot, "AllowRasterization" -> True,
ImageSize -> 360, ImageResolution -> 600]
This uses vectors for simple graphics, but produces a high resolution rasterized image if the plot becomes too complicated.
Comments
Post a Comment