I'm trying to fit two over-sized figures side by side on one page. I tried using minipage and adjustwidth, but the caption on the second figure kept mis-aligning to the left, as shown below.
I tried reading multiple seemingly related questions, but I wasn't able to figure this out. I tried using subfigure following one of the suggestions, but that seemed to do worse.
Any tips would be appreciated. Thanks.
\documentclass{article} % letter paper and 11pt font
\usepackage[space]{grffile} % for filenames with spaces
\usepackage{float}
\usepackage{graphicx}
\usepackage{chngpage}
\usepackage{caption}
\usepackage{calc}
\begin{document}
\begin{minipage}[t]{.5\textwidth} % example that almost works
\begin{figure}[H]
\begin{adjustwidth}{-\oddsidemargin-1in}{-\rightmargin}
\centering
\caption{Schooling Time Shares}
\includegraphics[scale=0.5]{Schooling Time Share over Time.png}
\end{adjustwidth}
\end{figure}
\end{minipage}%
\begin{minipage}[t]{.5\textwidth}
\begin{figure}[H]
\begin{adjustwidth}{\oddsidemargin-0.8in}{-\rightmargin}
\centering
\caption{Training Time Shares}
\includegraphics[scale=0.5]{Training Time Share over Time.png}
\end{adjustwidth}
\end{figure}
\end{minipage}
\end{document}
Update: After Mico's expert suggestions, I tried the following:
\begin{figure}[ht!]
\begin{adjustwidth}{-1.85cm}{-1.75cm} % choose margin adjustments
\begin{minipage}{0.48\linewidth}
\caption{Schooling Time Shares}
\includegraphics[scale=0.5]{Schooling Time Share over Time.png}
\end{minipage}
\hspace*{\fill} % spread out the two minipages
\begin{minipage}{0.48\linewidth}
\caption{Training Time Shares}
\includegraphics[scale=0.5]{Training Time Share over Time.png}
\end{minipage}
\end{adjustwidth}
\end{figure}
which produced the following output:
Now the captions are symmetric, which is much better than before. One last remaining bit, though, is: If one (perhaps unnecessarily) wanted to make the captions come more closely to the center, how could one do this? I thought maybe I could introduce a few spaces next to the caption, but an hspace* or mbox only shifted the caption down, not to the right.
Update2: As commented below \caption{\kern0.2cm Schooling Time Shares}
is able to move the caption text slightly to the right. Also width=1.1\linewidth
is more stable than scale=0.5
. Final code:
\begin{figure}[ht!]
\begin{adjustwidth}{-3.5cm}{-3cm} % choose margin adjustments
\begin{minipage}{0.48\linewidth}
\caption{\kern0.2cm Schooling Time Shares }
\includegraphics[width=1.1\linewidth]{Schooling Time Share over Time.png}
\end{minipage}
\hspace*{\fill} % spread out the two minipages
\begin{minipage}{0.48\linewidth}
\caption{\kern0.2cm Training Time Shares }
\includegraphics[width=1.1\linewidth]{Training Time Share over Time.png}
\end{minipage}
\end{adjustwidth}
\end{figure}
produces
Update 3: See Bernard's solution below with the floatrow
package. It may be the most concise.
Best Answer
I would use a single
figure
environment, start theadjustwidth
environment inside thefigure
environment, and use twominipage
environments, side by side, to display the two images; each can be given its own\caption
. (The frame lines in the screenshot depict the ordinary page margins.)Addendum: You mention in a comment that you weren't sure whether you should use subfigures. That decision depends mostly on how the two images are related to each other. If they're not particularly related, it makes sense to assign separate, figure-level captions to them. If, on the other hand, they're related quite closely, it's probably a good idea to treat them as
subfigure
s. Fortunately, it's not hard to do so: (i) load thesubcaption
package instead of (or in addition to) thecaption
package, (ii) replaceminipage
withsubfigure
(four instances), and (iii) provide a new\caption
statement for the overall figure. The earlier captions, previously numbered 1 and 2, will now be labeled (a) and (b).