有人能帮我解决这个问题吗?我尝试了以下两种方法,但都无法将图像放在整个页面中:
enter code here
-------Option 1------------
\begin{figure}[htp]
\centering
\includegraphics[width=.1\textwidth]{images/T1_W5.png}\hfill
\includegraphics[width=.1\textwidth]{images/T1_W9.png}\hfill
\includegraphics[width=.1\textwidth]{images/T1_W11.png}\hfill
\includegraphics[width=.1\textwidth]{images/T1_W15.png}\hfill
\caption{default}
\label{fig:figure3}
\end{figure}
-----------Option 2-----
\begin{figure}
\begin{tabular}{cccc}
{\includegraphics[width = .5in]{T1.png}} &
{\includegraphics[width = .75in]{T2.png}} &
{\includegraphics[width = .7in]{T3.png}} &
{\includegraphics[width = .7in]{T4.png}}&\\
{\includegraphics[width = .5in]{T1.png}} &
{\includegraphics[width = .75in]{T2.png}} &
{\includegraphics[width = .7in]{T3.png}} &
{\includegraphics[width = .7in]{T4.png}}&
\end{tabular}
\caption{Input Images}
\end{figure}
\begin{figure*}[p]
\begin{tabular}{ccccc}
\subfloat[a ]{\includegraphics[width = 0.6in]{T1.png}} &
{\includegraphics[width=0.2\textwidth]{images/T1_W5.png}} &
{\includegraphics[width=0.2\textwidth]{images/T1_W9.png}} &
{\includegraphics[width=0.2\textwidth]{images/T1_W11.png}}&
{\includegraphics[width=0.2\textwidth]{images/T1_W15.png}} &\\
{\includegraphics[width = 0.6in]{T2.png}} &
{\includegraphics[width=0.2\textwidth]{images/T2_W5.png}} &
{\includegraphics[width=0.2\textwidth]{images/T2_W9.png}} &
{\includegraphics[width=0.2\textwidth]{images/T2_W11.png}}&
{\includegraphics[width=0.2\textwidth]{images/T2_W15.png}} &\\
{\includegraphics[width = 0.6in]{T3.png}} &
{\includegraphics[width=0.2\textwidth]{images/T3_W5.png}} &
{\includegraphics[width=0.2\textwidth]{images/T3_W9.png}} &
{\includegraphics[width=0.2\textwidth]{images/T3_W11.png}}&
{\includegraphics[width=0.2\textwidth]{images/T3_W15.png}} &\\
{\includegraphics[width = 0.6in]{T4.png}} &
{\includegraphics[width=0.2\textwidth]{images/T4_W5.png}} &
{\includegraphics[width=0.2\textwidth]{images/T4_W9.png}} &
{\includegraphics[width=0.2\textwidth]{images/T4_W11.png}}&
{\includegraphics[width=0.2\textwidth]{images/T4_W15.png}} &\\
{\includegraphics[width = 0.6in]{T5.png}} &
{\includegraphics[width=0.2\textwidth]{images/T5_W5.png}} &
{\includegraphics[width=0.2\textwidth]{images/T5_W9.png}} &
{\includegraphics[width=0.2\textwidth]{images/T5_W11.png}}&
{\includegraphics[width=0.2\textwidth]{images/T5_W15.png}} &\\
\end{tabular}
\caption{Input Images}
\end{figure*}
答案1
看看以下 MWE 是否能帮助你:
编辑:
更简单的是使用tabularx
表格环境tabular
(因为它自己执行列宽计算)。现在 MWE 包含 5 x 5 网格图像。
\documentclass{ieeetran}
\usepackage[demo]{graphicx}
\usepackage{stfloats} % for positioning of figure* on the same page
\usepackage{tabularx}
\begin{document}
\begin{figure*}[b]
\setkeys{Gin}{width=\\linewidth}
\setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth}{@{} p{1em}p{0.5in} *{4}{X} @{}}
a) & \includegraphics[height=0.5in]{T1.png}
& \includegraphics{T2.png}
& \includegraphics{T3.png}
& \includegraphics{T4.png}
& \includegraphics{T5.png} \\
b) & \includegraphics[height=0.5in]{T1.png}
& \includegraphics{T2.png}
& \includegraphics{T3.png}
& \includegraphics{T4.png}
& \includegraphics{T5.png} \\
c) & \includegraphics[height=0.5in]{T1.png}
& \includegraphics{T2.png}
& \includegraphics{T3.png}
& \includegraphics{T4.png}
& \includegraphics{T5.png} \\
d) & \includegraphics[height=0.5in]{T1.png}
& \includegraphics{T2.png}
& \includegraphics{T3.png}
& \includegraphics{T4.png}
& \includegraphics{T5.png} \\
e) & \includegraphics[height=0.5in]{T1.png}
& \includegraphics{T2.png}
& \includegraphics{T3.png}
& \includegraphics{T4.png}
& \includegraphics{T5.png} \\
\end{tabularx}
\caption{Input Images}
\end{figure*}
\end{document}
(红线表示页面布局)
笔记: figure*
只能放置在插入文本的下一页的顶部。stfloats
如果有足够的空间,使用该包可以将图像放置在页面的底部。