3

I have 4 subfigures in a 2x2 matrix, where the figures on the left are legends with varying widths and those on the right are plots of equal widths. I would like to have the figures in the 1st column left-aligned, and those on the right centered.

I'm using the Memoir class. Here's a MWE:

\documentclass{memoir}% http://ctan.org/pkg/memoir
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\newsubfloat{figure}% Allow subfloats in figure environment

\begin{document}

    \begin{figure}
        \centering

        \subbottom[]{%
            \includegraphics[width=0.5\linewidth]{example-image-a}}
        \subbottom[Fig. B]{%
            \includegraphics[width=0.4\linewidth]{example-image-b}}
        \subbottom[]{%
            \includegraphics[width=0.3\linewidth]{example-image-a}}
        \subbottom[Fig. B]{%
            \includegraphics[width=0.4\linewidth]{example-image-b}}

        \caption{Left-align the `A's and center the `B's}
    \end{figure}

\end{document}

And here's the figure upon compilation: enter image description here

Bonus: Get rid of the labels (a) and (c), and renumber the labels (b) and (d) to (a) and (c), respectively.

Another option would be using minipages within the figure environment, but the figures are numbered anew if I do this. The MWE for this case:

\documentclass{memoir}% http://ctan.org/pkg/memoir
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\newsubfloat{figure}% Allow subfloats in figure environment

\begin{document}

\begin{figure}
    \centering

    \begin{minipage}{\linewidth}
        \begin{minipage}{0.3\linewidth}
            \includegraphics[width=0.5\linewidth]{example-image-a}
        \end{minipage}
        \begin{minipage}{0.6\linewidth}
            \includegraphics[width=0.4\linewidth]{example-image-b}
        \end{minipage}
        \caption{This is a very very very long caption for figure 1}

        \vspace*{5mm}

        \begin{minipage}{0.3\linewidth}
            \includegraphics[width=0.3\linewidth]{example-image-a}
        \end{minipage}
        \begin{minipage}{0.6\linewidth}
            \includegraphics[width=0.4\linewidth]{example-image-b}
        \end{minipage}
        \caption{This is a very very very long caption for figure 2}
    \end{minipage}

    \caption{Outer caption}

\end{figure}


\end{document}

which when compiled looks like this: enter image description here

See how instead of Figure 0.3(a) and Figure 0.3(b), they are numbered as independent figures instead of subfigures.

Please let me know how I can solve this problem.

Thanks, Kavi

1 Answer 1

1

The OP is probably not interested as this is an old question. Though I had to find a solution since I was facing the same issue.

The {minipage} solution as the OP suggests works to an extent, we can remove the subcation labels (a) and (c), left align the 1st column figures and center the 2nd ones. MWE:

\documentclass{memoir}% http://ctan.org/pkg/memoir
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\newsubfloat{figure}% Allow subfloats in figure environment

\begin{document}

    \begin{figure}
        \centering
        \begin{minipage}{.5\linewidth}
            \includegraphics[width=\linewidth]{example-image-a}
            \includegraphics[width=0.6\linewidth]{example-image-a}
            \end{minipage}\hfill
            \begin{minipage}{.4\linewidth}
            \centering
        \subbottom[Fig. B]{%
            \includegraphics[width=\linewidth]{example-image-b}}
        \subbottom[]{%
            \includegraphics[width=\linewidth]{example-image-b}}
            \end{minipage}

        \caption{Left-align the `A's and center the `B's}
    \end{figure}

\end{document}

Solution with minipage

But A and B are not vertically aligned...

To get the aligment the OP wants 1st and 2nd row v-centered, 1st column left aligned and 2nd column center aligned we can use a {tabular} environment along with the valign option introduced by ajustbox:

\documentclass{memoir}% http://ctan.org/pkg/memoir
\usepackage[export]{adjustbox}% http://ctan.org/pkg/graphicx
\newsubfloat{figure}% Allow subfloats in figure environment

\begin{document}
    \begin{figure}
        \centering
        \begin{tabular}{lc}
            \includegraphics[width=.5\linewidth,valign=c]{example-image-a} &\subbottom[Fig. B]{%
            \includegraphics[width=.4\linewidth,valign=c]{example-image-b}}\\
            \includegraphics[width=0.3\linewidth,valign=c]{example-image-a} &\subbottom[]{%
            \includegraphics[width=.4\linewidth,valign=c]{example-image-b}}\\
            \end{tabular}
        \caption{Left-align the `A's and center the `B's}
    \end{figure}
\end{document}

Solution with tabular

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .