I am currently working on a conference presentation and I am using the very nice tikz
and pgfplots
packages in combination with beamer
.
To stress out some content in my figures, I use beamer
's overlay system.
When I use some small tikzpicture
s everything is integrated inside the document using some \input
commands. However, for large pgfplots
figures (you see me coming), I have quite long compilation times.
My current solution is to precompile my big pictures separately using multiple tikzpicture
s and to call some \includegraphics
with overlay options.
Beamer code
\documentclass{beamer}
\begin{document}
\begin{frame}
\includegraphics<1>[page=1]{image}
\includegraphics<2>[page=2]{image}
\includegraphics<3->[page=3]{image}
\end{frame}
\end{document}
where image
is built using
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]
% Plot to be displayed on overlay 1
\addplot[domain=0:1,samples=100]{x};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[]
% Plots to be displayed on overlay 2
\addplot[domain=0:1,samples=100]{x};
\addplot[domain=0:1,samples=100]{x^2};
\end{axis}
\end{tikzpicture}
% And so on
\end{document}
I know there are some externalization ways to do this, but I was wondering what the opinion of the community was on this matter.
Sorry in advance, if this is a double.
EDIT related to standalone
beamer
option
Using standalone
with the beamer
option seems to produce an nteresting result (thanks samcarter). However, the output has the size of a beamer
frame, instead of fitting the pgfplots axis. See the MWE below.
\documentclass[beamer]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{standaloneframe}
\begin{tikzpicture}
\begin{axis}[]
\only<1>{\addplot[domain=0:1, samples=100]{x};}
\addplot[domain=0:1, samples=100]{x^2};
\addplot[domain=0:1, samples=100]{x^3};
\only<4>{\addplot[domain=0:1, samples=100]{x^4}};
\end{axis}
\end{tikzpicture}
\end{standaloneframe}
\end{document}