
In meiner Beamer-Präsentation habe ich drei Bilder und ein zusammengefügtes PDF, die ich mithilfe des Pakets animieren möchte animate
. Der Aufbau ist wie folgt: Die drei Bilder sind nebeneinander angeordnet und ich möchte das dritte Bild durch die Animation ersetzen. Das heißt, auf der ersten Folie möchte ich, dass die drei Bilder nebeneinander angeordnet sind und auf der zweiten Folie möchte ich, dass die beiden linken Bilder neben der Animation angeordnet sind (die Animation ersetzt also das dritte Bild).
Hier ist ein Bild:
Hier ist ein MWE, um zu zeigen, was ich versucht habe:
\documentclass[8pt]{beamer}
\usetheme{Luebeck}
\usefonttheme{serif}
\setbeamertemplate{itemize item}{\color{black} $\vcenter{\hbox{\tiny$\bullet$}}$} %style of item
\setbeamertemplate{footline}[frame number]{}
\setbeamertemplate{navigation symbols}{}
\usepackage{xcolor}
\usepackage{graphicx}
\setlength{\parskip}{0.75em}
\usepackage{animate}
\usepackage{tikzsymbols}
\begin{document}
\begin{frame}
\begin{figure}
\centering
\includegraphics<1->[width = 0.33\textwidth]{cont_lasso.pdf}
\includegraphics<1->[width = 0.33\textwidth]{cont_ridge.pdf}
\includegraphics<1>[width = 0.33\textwidth]{cont_enet.pdf}
\animategraphics<2>[autoplay, loop, width = 0.33\textwidth]{30}{enet_ani_merged}{}{}
\end{figure}
The \textit{shape} of the penalty can give some idea of the type of shrinkage imposed on the model.
\begin{itemize}
\item Sharp corners $\to$ sparsity! \Laughey[1.5][yellow][pink]
\item Round corners $\to$ only shrinkage!
\end{itemize}
\end{frame}
\end{document}
Die Dateinamen der drei Bilder sind cont_lasso.pdf
, cont_ridge.pdf
, und cont_enet.pdf
, und der Name der zusammengeführten PDF-Datei für die Animation ist enet_ani_merged.pdf
.
BEARBEITEN
Zur Verdeutlichung möchte ich es so machen, dass die Animation automatisch abgespielt wird, wenn ich mit der zweiten Folie beginne.
Nach einigen Experimenten scheint mein Problem darin zu liegen, dass das Platzieren des animategraphics
Befehls in einer figure
Umgebung nicht zulässig ist, und nicht an den Überlagerungen. Daher möchte ich nun wissen, wie ich die beiden Grafiken und die Animation in dieselbe Umgebung einfügen kann.
Antwort1
Ausgehend vom leandriis
Kommentar ist hier der Code für alle, die sehen möchten, wie die endgültige Ausgabe aussieht. Ich musste hinzufügen, noframenumbering
damit sich die Frame-Nummer nicht ändert.
\documentclass[8pt]{beamer}
\usetheme{Luebeck}
\usefonttheme{serif}
\setbeamertemplate{itemize item}{\color{black} $\vcenter{\hbox{\tiny$\bullet$}}$} %style of item
\setbeamertemplate{footline}[frame number]{}
\setbeamertemplate{navigation symbols}{}
\usepackage{xcolor}
\usepackage{graphicx}
\setlength{\parskip}{0.75em}
\usepackage{animate}
\usepackage{tikzsymbols}
\begin{document}
\begin{frame}{Contour plots}
\begin{figure}
\centering
\includegraphics[width = 0.33\textwidth]{cont_lasso.pdf}
\includegraphics[width = 0.33\textwidth]{cont_ridge.pdf}
\includegraphics[width = 0.33\textwidth]{cont_enet.pdf}
%\animategraphics[autoplay, loop, width = 0.33\textwidth]{30}{enet_ani_merged}{}{}
\end{figure}
The \textit{shape} of the penalty can give some idea of the type of shrinkage imposed on the model.
\begin{itemize}
\item Sharp corners $\to$ sparsity! \Laughey[1.5][yellow][pink]
\item Round corners $\to$ only shrinkage!
\end{itemize}
\end{frame}
\begin{frame}[noframenumbering]{Contour plots}
\begin{figure}
\centering
\includegraphics[width = 0.33\textwidth]{cont_lasso.pdf}
\includegraphics[width = 0.33\textwidth]{cont_ridge.pdf}
%\includegraphics[width = 0.33\textwidth]{cont_enet.pdf}
\animategraphics[autoplay, loop, width = 0.33\textwidth]{30}{enet_ani_merged}{}{}
\end{figure}
The \textit{shape} of the penalty can give some idea of the type of shrinkage imposed on the model.
\begin{itemize}
\item Sharp corners $\to$ sparsity! \Laughey[1.5][yellow][pink]
\item Round corners $\to$ only shrinkage!
\end{itemize}
\end{frame}
\end{document}
Hier ist ein Screenshot der Ausgabe (ich konnte keine Möglichkeit finden, das PDF aufzuzeichnen, die rechte Figur soll sich bewegen):