如何为多个子图添加标题,其代码如下
\begin{figure}[h]
\centerline{%
\includegraphics[width=0.5\textwidth]{CircleTemplate.eps}%
\includegraphics[width=0.5\textwidth]{CircleOlimpicStarting.eps}%
}%
\centerline{%
\includegraphics[width=0.5\textwidth] {CircleOlimpicFinishing.eps}%
\includegraphics[width=0.5\textwidth] {CircleOlimpicFinishingWithNoise.eps}%
}%
\caption{Some long long caption}
\label{fig:OlimpicCircleTT1}
\end{figure}
答案1
看看子图包并使例如第一个简单示例适合您的代码。
\documentclass{article}
\usepackage{subfig}
\begin{document}
\begin{figure}%
\centering
\subfloat[First.]{...}\qquad
\subfloat[Second figure.]{...}\\
\subfloat[Third.]{\label{3figs-c}...}%
\caption{Three sub-floats.}
\label{3figs}
\end{figure}
\end{document}
答案2
另一个解决方案可以基于subcaption
包及其subfigure
环境。每个subfigure
环境可以包含一个\caption
and\label
语句,因此可以使用该机制进行交叉引用\ref
。
\documentclass{article}
\usepackage[demo]{graphicx} % remove "demo" option in your real document
\usepackage{subcaption} % provides "subfigure" environment
\begin{document}
\begin{figure}
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=1\linewidth]{CircleTemplate.eps}
\caption{First subfigure caption}\label{fig:a}
\end{subfigure}
\hspace*{\fill} % spread out the first and second subfigures
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=1\linewidth]{CircleOlimpicStarting.eps}%
\caption{Second subfigure caption}\label{fig:b}
\end{subfigure}
\bigskip % create some vertical separation between the two rows of subfigures
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=1\linewidth] {CircleOlimpicFinishing.eps}
\caption{Third subfigure caption}\label{fig:c}
\end{subfigure}
\hspace*{\fill} % spread out the third and fourth subfigures
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=1\linewidth] {CircleOlimpicFinishingWithNoise.eps}%
\caption{Fourth subfigure caption}\label{fig:d}
\end{subfigure}
\caption{Some long long caption} \label{fig:OlimpicCircleTT1}
\end{figure}
\end{document}