[Tex/LaTex] Beamer only and visible

beameroverlaystransition

\begin{frame}{Convex polygon \& concave polygon}
    \begin{definition}
        A \textbf{convex} polygon has all its diagonals inside the polygon. \\
        A \textbf{concave} polygon has at least one diagonal outside the polygon.
    \end{definition}
        \only<2>{ \includegraphics[width=\textwidth]{concave_convex.pdf} }
        \only<3>{ \includegraphics[width=\textwidth]{concave_convex_ans.pdf} }
\end{frame}

At the moment, the 1st slide does not take account into the space occupied by the graph, as shown below:
enter image description here
enter image description here
enter image description here

How can I make sure that the first slide takes account into the graph, so that the definition is NOT vertically centered.

Thanks.

Best Answer

Edit: it seems that the simplest solution is add option [t] to the frame:

    \documentclass{beamer}

    \begin{document}
\begin{frame}[t]{Convex polygon \& concave polygon}
    \begin{definition}
        A \textbf{convex} polygon has all its diagonals inside the polygon. \\
        A \textbf{concave} polygon has at least one diagonal outside the polygon.
    \end{definition}
    \bigskip 
    \centering  
        \only<2>{\includegraphics[width=0.5\textwidth]{example-image-a}}
        \only<3>{\includegraphics[width=0.7\textwidth]{example-image-b}}   

\end{frame}
    \end{document}

enter image description here