Beamer – How to Show Images Step by Step in the Same Location

beamer

I'm trying to show images step by step at the same location. This is my code:

\documentclass[xcolor=dvipsnames]{beamer}

\begin{document}
\section{Approach}

\begin{frame}{Approaches}
\only<1->{
Hello, world.
}

\only<2>{
   \begin{figure}[ht]
       \includegraphics[width=5cm]{pic/intro2.pdf}
    \end{figure}
 }
\only<3>{
   \begin{figure}[ht]
       \includegraphics[width=5cm]{pic/intro3.pdf}
    \end{figure}
 }

\end{frame}

\end{document}

The issue is that the texts (Hello, world) varies in its location for each slide.
How can I fix the location?

enter image description here

When used with \visible command, the texts are located in the same locations, but this is not what I expect as I want to have the diagrams at the same location also.

enter image description here

The compiled pdf can be downloaded at: https://dl.dropboxusercontent.com/u/10773282/2014/tex.pdf

Best Answer

enter image description here

\documentclass[xcolor=dvipsnames]{beamer}

\begin{document}
\section{Approach}

\begin{frame}{Approaches}
\only<1->{
Hello, world.
}

\begin{figure}[ht]
    \begin{overlayarea}{5cm}{4cm} % your height
     \includegraphics[width=2cm]<2>{1.jpg}
     \includegraphics[width=2cm]<3>{3.jpg}
     \end{overlayarea}
\end{figure}

Bouh !
\end{frame}

\end{document}
Related Question