I currently have a figure that contains two subfigures. I want to add labels underneath each subfigure but I'm having trouble aligning them. The first subcaption seems to center from the perspective of both subfigures (i.e., the entire page) which leads to the second subcaption starting from what I assume is a new line. More specifically, the code that I have is:
\documentclass[10pt,journal,compsoc]{IEEEtran}
% *** SUBFIGURE PACKAGES ***
\ifCLASSOPTIONcompsoc
\usepackage[caption=false,font=footnotesize,labelfont=sf,textfont=sf]{subfig}
\else
\usepackage[caption=false,font=footnotesize]{subfig}
\fi
% subfig.sty, written by Steven Douglas Cochran, is the modern replacement
% for subfigure.sty, the latter of which is no longer maintained and is
% incompatible with some LaTeX packages including fixltx2e. However,
% subfig.sty requires and automatically loads Axel Sommerfeldt's caption.sty
% which will override IEEEtran.cls' handling of captions and this will result
% in non-IEEE style figure/table captions. To prevent this problem, be sure
% and invoke subfig.sty's "caption=false" package option (available since
% subfig.sty version 1.3, 2005/06/28) as this is will preserve IEEEtran.cls
% handling of captions.
% Note that the Computer Society format requires a sans serif font rather
% than the serif font used in traditional IEEE formatting and thus the need
% to invoke different subfig.sty package options depending on whether
% compsoc mode has been enabled.
%
% The latest version and documentation of subfig.sty can be obtained at:
% http://www.ctan.org/pkg/subfig
\usepackage{caption}
\usepackage{subcaption}
\begin{figure*}[!t]
\begin{subfigure}
\centering
\includegraphics[trim={0, 0, 0, 0}, width=\columnwidth]{figures/plot1.pdf}
\subcaption{Thing}
\end{subfigure}
\begin{subfigure}
\centering
\includegraphics[trim={0, 0, 0, 0}, width=\columnwidth]{figures/plot2.pdf}
\subcaption{Thing}
\end{subfigure}
\caption{Something.}
\label{fig:attention_score}
\end{figure*}
I've read from this answer that the subfigure takes an option for a subcaption anchor, and I accordingly added a [c]
to the right of each \begin{subfigure}
. That leads to this:
Neither image is what I want. How should I configure things so that each subcaption is centered directly beneath each subfigure? Thanks.
t
,c
, andb
"anchors" affect the vertical, not the horizontal, alignment of thesubfigure
.