I am trying to include a pair of subfigures in my two-column document, stacked one on top of the other. I want them to be right-justified; to achieve this with individual figures I have been using the adjustbox
package. When I try to use this package with the subfigures however, it stops laying them out one on top of the other – despite the new line command. A MWE is below:
\documentclass[a4paper,11pt,twocolumn]{article}
%Used for figures
\usepackage{graphicx}
\usepackage{float}
\usepackage{adjustbox}
% Document margins
\usepackage[hmarginratio=1:1,top=32mm,columnsep=20pt]{geometry}
%Deals with paragraph formatting
\usepackage{parskip}
%Allows sub-floats
\usepackage{subcaption}
%Text
\usepackage{lipsum}
%-------------------------------------------------------------%
\begin{document}
%Stop stretching of text on last page
\raggedbottom
\section{Introduction}
\lipsum[2]
\begin{figure}[H]
\begin{adjustbox}{right}
\begin{subfigure}[H]{0.6\textwidth}
\includegraphics[width=\textwidth]{graph1}
\caption{Graph1.}
\label{fig:graph1}
\end{subfigure}
\\
\begin{subfigure}[H]{0.6\textwidth}
\includegraphics[width=\textwidth]{graph2}
\caption{Graph2.}
\label{fig:graph2}
\end{subfigure}
\end{adjustbox}
\caption{Graphs}\label{fig:graphs}
\end{figure}
\lipsum[1]
\end{document}
Thanks
Best Answer
You can get the two subfigures stacked vertically and sticking out to the left by encasing them in separate
adjustbox
environments. Incidentally, observe that there's no point in specifying the[H]
positioning specifier for the twosubfigure
environments. And, as @Sigur has already noted in a comment, do use\columnwidth
rather than\textwidth
for the widths of thesubfigure
s and\linewidth
for the width of the graphs.To reproduce just the figure-related code:
The resulting figure looks like this (note that I had to load the
graphicx
package since you didn't post the graphs referenced in the code):