15

This question already has an answer here:

I was wondering if there is a way to have a figure in a slide that replace the previous figure. So if one has 5 figures then each figure will appear once and be replaced by the next figure. At the end of the slide, the last figure will be shown.

I have tried the following, but I am sure it's not the best way.

\begin{frame}
    Here is an example.
\begin{example}
   Let a finite sequence of real numbers be $(1,2,3,4,5,6,7,8,9,10)$.
\end{example}
\pause
\begin{minipage}{\textwidth}
    \begin{itemize}
      \item<1|only@1>\includegraphics[width=8cm]{figure1.png}
      \item<2|only@2>\includegraphics[width=8cm]{figure2.png}
      \item<3|only@3>\includegraphics[width=8cm]{figure3.png}
      \item<4|only@4>\includegraphics[width=8cm]{figure4.png}
      \item<5|only@5>\includegraphics[width=8cm]{figure5.png}
    \end{itemize}
\end{minipage}
\end{frame}

The problem with above code is that the first figure is not shown and bullet points are also shown since it's a itemize environment.

I would appreciate any help or suggestion.

Thank you.

marked as duplicate by cmhughes, Community Nov 24 '15 at 19:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    have you seen One image per overlay?? does it help? let us know :) – cmhughes Nov 24 '15 at 18:55
  • @cmhughes Yes, it did. :) Thank you very much. – johnny09 Nov 24 '15 at 19:11
  • That's great, glad it helped :) would you consider your question a duplicate, or are there other parts that you're not sure about? – cmhughes Nov 24 '15 at 19:16
  • @cmhughes Yeah, I think it's a duplicate. – johnny09 Nov 24 '15 at 19:20
22

You may also consider using the overprint command.

\begin{figure}
    \begin{overprint}
    \onslide<1>\includegraphics{./figure1.png}
    \onslide<2>\includegraphics{./figure2.png}
    \onslide<3>\includegraphics{./figure3.png}
    \onslide<4->\includegraphics{./figure4.png}
    \end{overprint}
\end{figure}
  • 2
    how do you center the images horzontally using this approach? mine are flushed left, when I use overprint – thymaro Mar 20 '18 at 11:24
  • To center them, use \onslide<1>\centering\includegraphics. – SvanN Jan 7 at 8:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.