Incluindo imagens e animações no mesmo ambiente

Incluindo imagens e animações no mesmo ambiente

Na minha apresentação do beamer, tenho três imagens e um PDF mesclado que desejo animar usando o animatepacote. A configuração é a seguinte: as três imagens estão alinhadas uma ao lado da outra e quero substituir a terceira imagem pela animação. Ou seja, no primeiro slide quero que as três imagens fiquem uma ao lado da outra, e no segundo slide quero que as duas imagens da esquerda fiquem ao lado da animação (então a animação está substituindo a terceira imagem).

Aqui está uma foto:

insira a descrição da imagem aqui

Aqui está um MWE para mostrar o que tentei fazer:

\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}

Os nomes dos arquivos das três imagens são cont_lasso.pdf,, cont_ridge.pdfe cont_enet.pdf, e o nome do PDF mesclado para a animação é enet_ani_merged.pdf.

EDITAR

Para esclarecimento, quero fazer com que a animação comece a ser reproduzida automaticamente quando eu iniciar o segundo slide.

Depois de algumas experiências, parece que meu problema é porque não é permitido colocar o animategraphicscomando dentro de um figureambiente, e não por causa das sobreposições. Então agora quero saber, como consigo colocar os dois gráficos e a animação no mesmo ambiente?

Responder1

Saindo dos leandriiscomentários, aqui está o código para quem quiser ver como fica o resultado final. Tive que adicionar noframenumberingpara que o número do quadro não mudasse.

\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}

Aqui está uma captura de tela da saída (não consegui encontrar uma maneira de gravar a tela do pdf, a figura certa deve estar em movimento):

insira a descrição da imagem aqui

informação relacionada