I'm trying to align some figures using the subcaption package.
My current code is that:
\documentclass[11pt,twocolumn]{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage{caption}
\begin{document}
\begin{figure}[htpb]
\subcaptionbox{}
{\includegraphics[width=0.48\columnwidth]{figs/Fig_a}} \hspace{.5em}
{\includegraphics[width=0.2\columnwidth]{figs/legend} phantomsubcaption}
\subcaptionbox{}
{\includegraphics[width=0.48\columnwidth]{figs/Fig_b}} \hfill
\subcaptionbox{}
{\includegraphics[width=0.48\columnwidth]{figs/Fig_c}}
\caption{}
\end{figure}
\end{document}
Which produces:
However, I would like the first image to be left alined. I tried to use this:
\usepackage[export]{adjust box}
\captionsetup{justification=raggedright, singlelinecheck=false}
\begin{figure}[htpb]
\subcaptionbox{}
{\includegraphics[width=0.48\columnwidth, left]{figs/Fig_a}} \hspace{.5em}
{\includegraphics[width=0.2\columnwidth]{figs/legend} phantomsubcaption}
\subcaptionbox{}
{\includegraphics[width=0.48\columnwidth]{figs/Fig_b}} \hfill
\subcaptionbox{}
{\includegraphics[width=0.48\columnwidth]{figs/Fig_c}}
\caption{}
\end{figure}
With no success:
Also, the image with the \phantomsubcaption doesn't have the same heigh as Figure (a) and I would like it to be center vertically aligned, and not bottom or top, i.e., aligned with the center of Figure (a). Is that possible?
Thank you.
Best Answer
Is this what you want? Just place the narrow figure in the first
\subcaptionbox
.If you want that (a) is centered with respect to the wide image, you can insert the narrow image in a zero width box:
If you want left aligned subcaptions, tell so to
caption
:The
\captionsetup[subfigure]{singlelinecheck=false}
can also go in the preamble, so it will affect all subcaptions.