[Tex/LaTex] Caption of each figure at the same line at the bottom

captionsfloatspositioning

I use the following for side by side figures. However, the caption of the left figure is positioned higher than the right. How can I make the caption position be at the same line?

\documentclass{article}
\usepackage{graphicx}

        \begin{document}

            \begin{figure}[H]
                \centering
            \begin{minipage}{.45\linewidth}
                \includegraphics [width=\linewidth]{example-image-a}
                \caption{Text for A}
            \label{fig:VisJ48}
                    \end{minipage}
                \hspace{.05\linewidth}
            \begin{minipage}{.45\linewidth}
                \includegraphics [width=\linewidth]{example-image-b}
                \caption{Text for B}
            \label{fig:TextJ48}
            \end{minipage}
            \end{figure}
    \end{document}

Best Answer

Add [b] to minipages, it will vertically align them to the bottom. \begin{minipage}[b]{.45\linewidth}

As pointed out by Mico, there is no use for \centering here.

Output

enter image description here

Code

\documentclass{article}
\usepackage{graphicx}
    \begin{document}
        \begin{figure}[h]
        \begin{minipage}[b]{.45\linewidth}
            \includegraphics[width=.5\linewidth]{example-image-a}
            \caption{J48 visual representation of IRIS dataset}
        \label{fig:VisJ48}
                \end{minipage}%
                \hfill%
        \begin{minipage}[b]{.45\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{J48 Textual representation of IRIS dataset}
        \label{fig:TextJ48}
        \end{minipage}
        \end{figure}
\end{document}
Related Question