Suppose I have four small figures and I want to use Subfloat to produce a figure with captions similar to upper panels of the following figure:
Here is what I have done, but as you can see, the captions are not centered.
\documentclass{article}
\usepackage{graphicx}
\usepackage[labelformat = simple]{subfig}
\renewcommand{\thesubfigure}{Panel (\Alph{subfigure})}
\begin{document}
\begin{figure}
\centering
\caption{Rate of Y Over Time}
\subfloat[Horizon: One Month \newline Trend: $0.43 + 0.14 \tau,\;p = 0.00$]{ \includegraphics[ height=6cm, width=0.45\columnwidth]{./H1}}\qquad
\subfloat[Horizon: Three Month \newline Trend: $0.46 + 0.11 \tau,\;p = 0.00$]{ \includegraphics[ height=6cm, width=0.45\columnwidth]{./H3}}
\subfloat[Horizon: Six Month \newline Trend: $0.46 + 0.08 \tau,\;p = 0.00$]{ \includegraphics[ height=6cm, width=0.45\columnwidth]{./H6}}\qquad
\subfloat[Horizon: Twelve Month \newline Trend: $0.57 + 0.03\tau,\;p = 0.27$]{ \includegraphics[ height=6cm, width=0.45\columnwidth]{./H12}}
\end{figure}
\end{document}
Best Answer
like this?
centering of
subloat
caption with\newline
for force text break to two lines doesn't work well. instead this move second line of caption to\subfloat
's content as title of images as is shown in mwe below:addendum (1): an alternative to above solution is use
considering this, above solution become
where we can see, that with this solution the second line of caption belong to caption and not to "title" of image" as solution before. what is better is matter of personal preferences :)
addendum (2): equivalent solution with
subcaption
package (which has some features superior tosubfig
package):