我通过添加命令完成了此操作,caption
如下面的代码片段所示,但它不起作用:
\begin{figure*}[ht]
\begin{center}
$\begin{array}{rl}
\includegraphics[width=0.45\textwidth]{images/chapter4/img_1.png}\caption{Training set} &
\includegraphics[width=0.45\textwidth]{images/chapter4/img_2.png}\caption{Validation set}\\
\multicolumn{2}{c}{\includegraphics[width=0.45\textwidth]{images/chapter4/img_3.png.png}\caption{Test set}}
\end{array}$
\caption{Overall caption.}
\end{center}
\end{figure*}
我只看到整体的标题,但我还需要每张图片下方的标题。
答案1
最好使用子图:
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage[position=top]{subfig}% needed <<<<<<<<<<
\begin{document}
\begin{figure*}[hp!]
\centering
\subfloat[Training set]{%
\includegraphics[width=0.45\textwidth]{example-image}
}\hfill
\subfloat[Validation set]{%
\includegraphics[width=0.45\textwidth]{example-image}
}\\
\subfloat[Test set]{%
\includegraphics[width=0.45\textwidth]{example-image}
}
\caption{Overall caption.}
\label{fig:images}
\end{figure*}
See the used sets in the figure \ref{fig:images}.
\end{document}
答案2
这是一个使用该floatrow
软件包的简单解决方案:
\documentclass[twocolumn]{article}
\usepackage[draft]{graphicx}
\usepackage{caption, floatrow}
\DeclareCaptionSubType[alph]{figure}
\begin{document}
\begin{figure*}[!ht]
\ffigbox{\centering
\begin{subfloatrow}[2]
\ffigbox{\includegraphics[width=0.45\textwidth]{images/chapter4/img_1.png}}{\caption{Training set}\label{TS}}
\ffigbox{\includegraphics[width=0.45\textwidth]{images/chapter4/img_2.png}}{\caption{Validation set}\label{VS}}
\end{subfloatrow}
\vskip 4ex
\begin{subfloatrow}[1]
\ffigbox{\includegraphics[width=0.45\textwidth]{images/chapter4/img_3.png.png}}{\caption{Test set}\label{TS}}
\end{subfloatrow}}
{\caption{Overall caption.}\label{OC}}
\end{figure*}
\end{document}