[Tex/LaTex] need to put a figure above another figure in beamer

beamergraphicspositioning

In beamer I created a slide like

enter image description here

using code

\documentclass[slidestop,compress,mathserif]{beamer}
\usepackage[latin1]{inputenc}
\usepackage{verbatim}
\usepackage{graphicx}
\usetheme{Boadilla}
\usecolortheme{beaver} %{beetle}%{crane} 
\usepackage{textpos}
\usepackage{tikz}

\title[Madgraph Vs Phantom]{Introduction to Pile-Up}
\author[Ramkrishna Sharma]{Ramkrishna Sharma}
\institute[]{University of Delhi}
\date{August 24, 2014}

\setbeamertemplate{footline}[slide number]
\setbeamertemplate{frametitle}[default][center]
\begin{document}
    \begin{frame}\frametitle{Mass of Two tagged Jet }
         \includegraphics[width=12cm,height=8cm]{Massesjj.pdf}
    \end{frame}

\end{document}

Now, I need to put another figure on the figure displayed in the figure. and it should appear when I press enter.

Also I need to put an arrow to from figure to point a point in the figure which is already there. As shown in figure below:enter image description here

The Black box should be replaced by another figure in next click.

Please suggest what should I do.

Best Answer

As you want to draw an arrow it is probably easiest to put everything inside a tikzpicture environment.

Before I answer your question let me say that using

\includegraphics[width=12cm,height=8cm]{Massesjj.pdf}

to include your image is probably a mistake. It is better to specify either the height that you want, or the width, but not both as this may skew the image. If you only specify the "important" dimension then the other one will be scaled, without changing the aspect ratio of the image.

In order to put the second image on top after you have displayed the first image you an use the pause command. The image is for the second slide:

enter image description here

...and here is how this was done:

\documentclass{beamer}
\usepackage{graphics}
\usepackage{tikz}% this is necessary for drawing arrows
\usepackage{mwe}% you can omoit this one, it's just needed for the images
\begin{document}

\begin{frame}\frametitle{Mass of Two tagged Jet }
  \begin{tikzpicture}[every node/.style={anchor=center}]
    \node(a) at (8,4){\includegraphics[width=10cm]{example-image-a}};
    \pause
    \node(b) at (10,5){\includegraphics[width=5cm]{example-image-b}};
    \draw[red,thick,->](10,5)--(4,4);
  \end{tikzpicture}
\end{frame}
\end{document}
Related Question