Graphics, Figures & TablesAnimated PDF image in beamer

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
milujisb
Posts: 2
Joined: Mon Jun 24, 2019 3:41 pm

Animated PDF image in beamer

Post by milujisb »

Dear community,

I would like to add figure (a) from this plot - https://github.com/burke-lab/BDD2018/bl ... igure1.pdf. Unfortunately, the size was too big to be attached.

I am using beamer to make my presentation and would like the image to be animated as it is in the PDF when the slide containing the figure is displayed. I have tried zoombox but without success. Any help will be greatly appreciate. Thank you.

Sincerely,

Milu

Code: Select all

\documentclass[11pt]{beamer}
\usetheme{EastLansing}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10312
Joined: Mon Mar 10, 2008 9:44 pm

Animated PDF image in beamer

Post by Stefan Kottwitz »

Hi Milu,

welcome to the forum!

I attach the picture as a scaled screenshot:
plot.png
plot.png (324.12 KiB) Viewed 6096 times
> I have tried zoombox but without success

Can you post the code that you tried so we can help to fix or improve it?

Stefan
LaTeX.org admin
milujisb
Posts: 2
Joined: Mon Jun 24, 2019 3:41 pm

Animated PDF image in beamer

Post by milujisb »

Thanks, Stefan. I am using the following code;

Code: Select all

\begin{figure}
\zoombox{\includegraphics[width=.8\textwidth]{figures/figure1.pdf}}
\label{fig:figure1}
\end{figure}
I would like the to display the figure as it is shown in the link, the curves showing up individually (sort of like an animation). Apologies if I have not described the issue well. Thanks again.

Sincerely,

Milu
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Animated PDF image in beamer

Post by Ijon Tichy »

With \visible and the definition of transition duration between slides you can emulate an animation, e.g.
\documentclass{beamer}
\usetheme{EastLansing}
\begin{document}
\begin{frame}
  \frametitle{Test}
  \begin{minipage}{.8\linewidth}
    \centering
    \visible<1-5>{%
      \makebox[0pt][c]{\includegraphics[width=\textwidth]{plot.png}}%
    }%
    \visible<2,4>{%
      \makebox[0pt][c]{%
        \fcolorbox{black}{white}{\includegraphics[clip,width=.25\textwidth,viewport=71mm 0 100mm 30.5mm]{plot.png}}%
      }%
    }%
    \visible<3>{%
      \makebox[0pt][c]{%
        \fcolorbox{black}{white}{\includegraphics[clip,width=.5\textwidth,viewport=71mm 0 100mm 30.5mm]{plot.png}}%
      }%
    }%
    \transduration<1,3>{10}%
    \transduration<2,4>{2}%
    \transfade<1-4>[duration=1]%
  \end{minipage}%
\end{frame}
\end{document}
This only works in presentation mode. Here the first slide (full image) is shown for 10 seconds. Then the segment of plot d is shown in a small frame for 2 seconds, then the same segment is shown in a larger size for 10 seconds, then again the small one for 2 seconds and last but not least only the full image.

Note: I've used Stefan's plot.png instead of your Figure1.pdf, because Figure1.pdf has a very large file size and rendering needs so much time, that the animation effec is almost invisible.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply