[Tex/LaTex] How to align figures vertically within a minipage

minipagevspace

I'm having trouble to define vertical spacing within a minipage, as \vspace seems to behave in a special way within it. For instance, in the example below I'd like to set the vertical spacing between figure A and B to 1cm, but it's being added at the end instead of in between the figures. What is the proper way of defining this spacing? Thanks, Jorge.

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}


\begin{figure*}[!t]
\fbox{\noindent\begin{minipage}[b][6cm]{0.45\linewidth}
    \includegraphics[height=2cm,width=1.0\linewidth]{example-image}
    \subfloat[]{\includegraphics[height=2cm,width=1.0\linewidth]{example-image}}
\end{minipage}}%
\hfill
\fbox{\noindent\begin{minipage}[b][6cm]{0.45\linewidth}
    \includegraphics[height=2cm,width=1.0\linewidth]{example-image-a}
    \vspace{1cm}
    \subfloat[]{\includegraphics[height=2cm,width=1.0\linewidth]{example-image-b}}
\end{minipage}}%
\end{figure*}
\end{document}

Results:

enter image description here

EDIT: Adding some blanks do alter the behavior, but I'm still unable to get it right; moreover; a spurious indentation appears!:

\begin{document}
\begin{figure*}[!t]
    \fbox{\noindent\begin{minipage}[b][6cm]{0.45\linewidth}
        \includegraphics[height=2cm,width=1.0\linewidth]{example-image}
        \subfloat[]{\includegraphics[height=2cm,width=1.0\linewidth]{example-image}}
    \end{minipage}}%
    \hfill
    \fbox{\begin{minipage}[b][6cm]{0.45\linewidth}
        \includegraphics[height=2cm,width=1.0\linewidth]{example-image-a}
        \\
        \\
        \vspace{1cm}
        \subfloat[]{\includegraphics[height=2cm,width=1.0\linewidth]{example-image-b}}
    \end{minipage}}%
\end{figure*}
\end{document}

Result:

enter image description here

Best Answer

If you use \vspace mid-paragraph then the space is added, after the paragraph has been broken in to lines, after the line where the vspace appeared. That means

  a\vspace{1cm} b

will typeset a b and then add 1cm of space after that line. This behaviour is well defined but almost never what you want, it is almost always better to leave a blank line before the \vspace so that the previous paragraph ends and TeX is in vertical mode so the space can be added at that point.

a

\vspace{1cm}
b

typesets a above b with 1cm more space than usual.

Note this behaviour of \vspace is unrelated to it being in a minipage or that the items in the paragraph are subfigures.