1

I am trying to create an SVG beamer presentation that will eventually embed videos using media4svg. While the video embedding works great, 3D plots are giving me trouble. Any ideas to export the following Beamer slide to an SVG file without compromising the 3D plot?

\documentclass{beamer}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{document}
    \begin{frame}
        \begin{tikzpicture}
            \begin{axis}
                \addplot3[ surf, shader=interp, samples=10, domain=0:1, ]{x^2*y};
            \end{axis}
        \end{tikzpicture}
    \end{frame}
\end{document}

The only ways I have been able to do it is using dvisvgm with shader=flat or using ImageMagick's convert tool that gives a rasterized SVG. Neither of those options are ideal!

Rushi
  • 837
  • 2
    The shading capabilities of SVG are quite limited compared to PDF. So it's almost impossible to directly convert the PDF gradients to corresponding SVG ones. They can only be approximated and therefore look either wrong or lead to pretty big SVG files due to many small grid elements required for the approximation. On top of that, your example creates a PDF with function-based Gouraud shading patterns which dvisvgm doesn't support. – Martin Mar 09 '24 at 09:35

0 Answers0