## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ TikZ surface plot file size

Information and discussion about graphics, figures & tables in LaTeX documents.
h4mmk
Posts: 1
Joined: Thu Sep 07, 2017 3:58 pm

### TikZ surface plot file size

Hi, I am plotting three-dimensional surfaces using pgfplots. An example follows.

\documentclass{standalone}\usepackage{pgfplots} \pgfplotsset{compat=1.14}   \begin{document}\begin{tikzpicture}\begin{axis}[view={20}{10},axis lines=none,xmin=-15, xmax=15,ymin=-15, ymax=15,zmin=-1, zmax=4] \addplot3[surf,            fill opacity=1,            draw opacity=1,           shader=interp,           colormap={outside}{color=(blue!40) color=(blue)},           point meta=-abs(x),             mesh/interior colormap={inside}{color=(red!40) color=(red)},           domain=0.01:15,            y domain=0:2*pi,           samples=30            ]           ({x*cos(deg(y))},{x*sin(deg(y))},{sqrt(x)}); \end{axis}\end{tikzpicture}\end{document}

When I compile this code with PDFLaTeX, the resulting PDF document is 900KB. I have many such surfaces in the master file that I am working on, so it has a huge file size. I can reduce the size of each surface by reducing the number 30 in "samples=30", but quality suffers.

My question, then, is whether anyone has advice on how my code could be adjusted to drastically reduce the size of the files, but retain the quality. Too much to ask for, perhaps, but any suggestions on this subject will be appreciated nonetheless! Thank you very much.

Tags:

Stefan Kottwitz
Posts: 8701
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
PDF compression could be used, such as, for example:

\pdfminorversion=5\pdfcompresslevel=9\pdfobjcompresslevel=3

Either for the single plot and include it as pdf image, or for the whole document. Another option would be compression by Ghostscript.

Stefan