我想放置四幅不同的图像,两幅在上,两幅在下,像一个矩阵一样,按子标题对齐。我使用了 \subfigure 环境,但图像很混乱。
\begin{figure}%
\centering
\subfigure[][]{
\label{fig:A}
\includegraphics[height=5.4cm]{ImageA}
}
\hspace{1cm}
\subfigure[][]{
\label{fig:B}
\includegraphics[height=5cm]{ImageB}
}\\
\subfigure[][]{
\label{fig:C}
\includegraphics[height=3.65cm]{ImageC}
}
\hspace{95pt}
\subfigure[][]{
\label{fig:D}
\includegraphics[height=3.65cm]{ImageD}
}
\hspace{20pt}
\caption[Set of four subfigures.]{Set of four subfigures:
\subref{fig:A} first subfigure;
\subref{fig:B} second subfigure;
\subref{fig:C} third subfigure; and,
\subref{fig:D} last subfigure.}%
\label{fig:Figure}%
\end{figure}
答案1
- 您的代码使用了过时的包
subfigure
。相反,最好使用subfloats[]{...}
它的取代subfig
(参见下面的代码片段) - 用以下方法替换子图形之间的所有固定距离
\hfill
通过这些改变你将获得:
\begin{figure}[htb]
\centering
\subfloat[]{ % <---
\label{fig:A}
\includegraphics[height=5.4cm]{ImageA}
}
\hfil
\subfloat[]{ % <---
\label{fig:B}
\includegraphics[height=5cm]{ImageB}
}
\subfloat[]{ % <---
\label{fig:C}
\includegraphics[height=3.65cm]{ImageC}
}
\hfil
\subfloat[]{ % <---
\label{fig:D}
\includegraphics[height=3.65cm]{ImageD}
}
\caption[Set of four subfigures.]{Set of four subfigures:
\subref{fig:A} first subfigure;
\subref{fig:B} second subfigure;
\subref{fig:C} third subfigure; and,
\subref{fig:D} last subfigure.}%
\label{fig:Figure}%
\end{figure}