如何在 IEEE trans 中插入带有标题的子图?

如何在 IEEE trans 中插入带有标题的子图?

我正在尝试向 IEEE trans 中的所有图插入一些带标题的子图,但我不想跨越两列。但这种方法行不通。我想执行以下操作: 在此处输入图片描述.我尝试了以下方法:

\begin{figure}[ht] 
  \begin{subfigure}[b]{0.25\linewidth}
    \centering
    \includegraphics[width=0.5\linewidth]{images/1a}
    \caption{} 
    \label{1a} 
    \vspace{4ex}
  \end{subfigure}%%
  \begin{subfigure}[b]{0.25\linewidth}
    \centering
    \includegraphics[width=0.5\linewidth]{images/1b}
    \caption{} 
    \label{1b} 
    \vspace{4ex}
  \end{subfigure}%%
  \begin{subfigure}[b]{0.25\linewidth}
    \centering
    \includegraphics[width=0.5\linewidth]{images/1c} 
    \caption{} 
    \label{1c} 
    \vspace{4ex}
  \end{subfigure}%%
  \begin{subfigure}[b]{0.25\linewidth}
    \centering
    \includegraphics[width=0.5\linewidth]{images/1d} 
    \caption{} 
    \label{1d}
    \vspace{4ex} 
    \end{subfigure}
  \caption{(a),(b)Some examples from CIFAR-10 \cite{4}. The objects in single-label
images are usually roughly aligned.(c),(d) However, the assumption of object alignment is not valid for multi-label
images. Also note the partial visibility and occlusion
between objects in the multi-label images.}
  \label{fig1} 
\end{figure}

我怎样才能实现它?

答案1

如果你读过IEEEtran文档,就会发现它建议不要使用subfigure包,而是使用subfig。其中还subfig解释了一个例子。

据我所知,你想要的是这样的:

在此处输入图片描述

可以通过以下代码获取:

\documentclass{IEEEtran}
\usepackage{lipsum}
\usepackage{graphicx}
\ifCLASSOPTIONcompsoc
    \usepackage[caption=false, font=normalsize, labelfont=sf, textfont=sf]{subfig}
\else
\usepackage[caption=false, font=footnotesize]{subfig}
\fi

\begin{document}

\section{A}
\lipsum

\section{B}
\lipsum[1-3]
\begin{figure} 
    \centering
  \subfloat[a\label{1a}]{%
       \includegraphics[width=0.45\linewidth]{example-image}}
    \hfill
  \subfloat[b\label{1b}]{%
        \includegraphics[width=0.45\linewidth]{example-image}}
    \\
  \subfloat[c\label{1c}]{%
        \includegraphics[width=0.45\linewidth]{example-image}}
    \hfill
  \subfloat[d\label{1d}]{%
        \includegraphics[width=0.45\linewidth]{example-image}}
  \caption{(a), (b) Some examples from CIFAR-10 \cite{4}. The objects in     
        single-label images are usually roughly aligned.(c),(d) However, the 
        assumption of object alignment is not valid for multi-label
        images. Also note the partial visibility and occlusion
        between objects in the multi-label images.}
  \label{fig1} 
\end{figure}
\lipsum[1-5]
\end{document}

答案2

这是另一种方法:

\usepackage{subfigure}

\begin{figure}
    \centering
    \subfigure[First caption]
    {
        \includegraphics[width=1.0in]{imagefile2}
        \label{fig:first_sub}
    }
    \\
    \subfigure[Second caption]
    {
        \includegraphics[width=1.0in]{imagefile2}
        \label{fig:second_sub}
    }
    \subfigure[Third caption]
    {
        \includegraphics[width=1.0in]{imagefile2}
        \label{fig:third_sub}
    }
    \caption{Common figure caption.}
    \label{fig:sample_subfigures}
\end{figure}

输出结果如下:

在此处输入图片描述

相关内容