我有 5 个图,我想在将其分成三个小页面后将它们显示在一页中。理想情况下,我在第一个小页面中有 2 个子图,在第二个小页面中有 2 个子图,在第三个小页面中只有一个子图,并且居中对齐。
我尝试了以下操作:
\documentclass[a4paper,10pt]{article}
\usepackage[demo]{graphicx}
\usepackage{subfigure}
\usepackage{amsmath}
\usepackage[paper=letterpaper,left=1.0in,right=1.0in,top=0.25in,bottom=1.0in,]{geometry}
\begin{document}
\begin{figure}
\begin{minipage}{03.\textheight}
\centering
\begin{subfigure}[a]{\includegraphics[width=.5\linewidth] {./pngs/profile_L_3lambda_max_1wl_0.png}
\label{fig:subfig1}
}%
\end{subfigure}
\begin{subfigure}[b]{\includegraphics[width=.5\linewidth]{./pngs/profile_L_3lambda_max_1wl_dft_0.png}
\label{fig:subfig2}
}%
\end{subfigure}
\label{fig:myfigure}
\end{minipage}
\begin{minipage}{03.\textheight}
\centering
\begin{subfigure}[c]{\includegraphics[width=.5\linewidth] {./pngs/profile_L_3lambda_max_1wl_0.png}
\label{fig:subfig1}
}%
\end{subfigure}
\begin{subfigure}[d]{\includegraphics[width=.5\linewidth]{./pngs/profile_L_3lambda_max_1wl_dft_0.png}
\label{fig:subfig2}
}%
\end{subfigure}
\label{fig:myfigure}
\end{minipage}
\begin{minipage}{03.\textheight}
\centering
\begin{subfigure}[f]{\includegraphics[width=\linewidth] {./pngs/profile_L_3lambda_max_1wl_0.png}
\label{fig:subfig1}
}%
\end{subfigure}
\caption{My caption}
\end{minipage}
\end{figure}
不幸的是,结果完全没有希望。有什么建议可以解决吗?提前谢谢
答案1
- 该包
subfigure
已过时。它已被替换subfig
。然而,更好的方法是使用该subcaption
包。 我不会用它们
minipage
来对你的子图进行分组,没有它们也可以做到这一点:\documentclass[a4paper,10pt]{article} \usepackage[demo]{graphicx} \usepackage{subcaption} \usepackage{amsmath} \usepackage[paper=letterpaper, left=1.0in,right=1.0in, top=0.25in,bottom=1.0in,]{geometry} \begin{document} \begin{figure} \centering \begin{subfigure}{0.45\linewidth} \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_0.png} \caption{} \label{fig:subfig1} \end{subfigure}\hfil \begin{subfigure}{0.45\linewidth} \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_dft_0.png} \caption{} \label{fig:subfig2} \end{subfigure} \smallskip \begin{subfigure}{0.45\linewidth} \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_0.png} \caption{} \label{fig:subfig3} \end{subfigure}\hfil \begin{subfigure}{0.45\linewidth} \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_dft_0.png} \caption{} \label{fig:subfig4} \end{subfigure} \smallskip \begin{subfigure}{0.45\linewidth} \includegraphics[width=\linewidth]{./pngs/profile_L_3lambda_max_1wl_0.png} \caption{} \label{fig:subfig5} \end{subfigure} \caption{My caption} \label{fig:my-figures} \end{figure} See Fig.~\ref{fig:my-figures}, particularly sub figure \ref{fig:subfig5} \dots \end{document}