一个图中有多个子图

一个图中有多个子图

我想将 81 个子图放在一个图中,并配上一个标题,每个子图都标有一个数字。每个子图大小相同(因此可能不需要这样做tabularx)。我想将 4 个子图放在一行中,如下所示,

SUBFIG1 & SUBFIG2 & SUBFIG3 & SUBFIG4

..

SUBFIG77 & SUBFIG78 & SUBFIG79 & SUBFIG80

SUBFIG81

图片说明:XXX

在每个子图下方,我想要一个括号内的数字,例如,在 SUBFIG1 下方,我想要 (1) 等等。

在乳胶中做到这一点的最佳方法是什么?我已经尝试了tabular环境

\documentclass{report}
\usepackage{subcaption}
\begin{figure}
\begin{tabular}{cccc}
\subfloat[(1)]{\includegraphics[width=2cm]{SUBFIG1.eps}} 
    & \subfloat[(2)]{\includegraphics[width=2cm]{SUBFIG2.eps}}
    &  \subfloat[(3)]{\includegraphics[width=2cm]{SUBFIG3.eps}} 
    & \subfloat[(4)]{\includegraphics[width=2cm]{SUBFIG4.eps}} \\
\subfloat[(5)]{\includegraphics[width=2cm]{SUBFIG5.eps}} 
    & \subfloat[(6)]{\includegraphics[width=2cm]{SUBFIG6.eps}}
 ...
\end{tabular}
\caption{XXX}
\label{xxx}
\end{figure}

但此处以subfloataz 作为计数分隔符,一旦我达到 24 个子图,它就会超出页面范围(即不会在新页面上开始子图 25)。谢谢!

答案1

由于所有图像的宽度相同,因此不需要使用表格类型。只需使用\subfloat指令来放置它们,每行四个。

由于您加载了subcaption标题(因此也加载了caption包),因此您可以\ContinuedFloat在每个连续的顶部使用指令figure

figure下面的截图展示了下面代码生成的最后一个环境。

在此处输入图片描述

\documentclass{report}
\usepackage[margin=2.5cm]{geometry} % set page parameters suitably
\usepackage[demo]{graphicx} % remove 'demo' option in real document

\usepackage{subcaption}
\renewcommand\thesubfigure{\arabic{subfigure}} % arabic numerals
\captionsetup[figure]{skip=0.5\baselineskip}
\captionsetup[subfigure]{skip=0.25\baselineskip,position=below}

\begin{document}

\begin{figure}[p]
\setkeys{Gin}{width=0.22\textwidth,height=0.125\textheight,keepaspectratio}
\caption{XXX}\label{fig:xxx}

\subfloat[]{\includegraphics{SUBFIG01}}\hfill
\subfloat[]{\includegraphics{SUBFIG02}}\hfill
\subfloat[]{\includegraphics{SUBFIG03}}\hfill
\subfloat[]{\includegraphics{SUBFIG04}}

\medskip
\subfloat[]{\includegraphics{SUBFIG05}}\hfill
\subfloat[]{\includegraphics{SUBFIG06}}\hfill
\subfloat[]{\includegraphics{SUBFIG07}}\hfill
\subfloat[]{\includegraphics{SUBFIG08}}

\medskip
\subfloat[]{\includegraphics{SUBFIG09}}\hfill
\subfloat[]{\includegraphics{SUBFIG10}}\hfill
\subfloat[]{\includegraphics{SUBFIG11}}\hfill
\subfloat[]{\includegraphics{SUBFIG12}}

\medskip
\subfloat[]{\includegraphics{SUBFIG13}}\hfill
\subfloat[]{\includegraphics{SUBFIG14}}\hfill
\subfloat[]{\includegraphics{SUBFIG15}}\hfill
\subfloat[]{\includegraphics{SUBFIG16}}

\medskip
\subfloat[]{\includegraphics{SUBFIG17}}\hfill
\subfloat[]{\includegraphics{SUBFIG18}}\hfill
\subfloat[]{\includegraphics{SUBFIG19}}\hfill
\subfloat[]{\includegraphics{SUBFIG20}}

\medskip
\subfloat[]{\includegraphics{SUBFIG21}}\hfill
\subfloat[]{\includegraphics{SUBFIG22}}\hfill
\subfloat[]{\includegraphics{SUBFIG23}}\hfill
\subfloat[]{\includegraphics{SUBFIG24}}

\end{figure}

\begin{figure}[p]
\setkeys{Gin}{width=0.22\textwidth,height=0.125\textheight,keepaspectratio}
\ContinuedFloat
\caption{XXX, continued}

\subfloat[]{\includegraphics{SUBFIG25}}\hfill
\subfloat[]{\includegraphics{SUBFIG26}}\hfill
\subfloat[]{\includegraphics{SUBFIG27}}\hfill
\subfloat[]{\includegraphics{SUBFIG28}}

\medskip
\subfloat[]{\includegraphics{SUBFIG29}}\hfill
\subfloat[]{\includegraphics{SUBFIG30}}\hfill
\subfloat[]{\includegraphics{SUBFIG31}}\hfill
\subfloat[]{\includegraphics{SUBFIG32}}

\medskip
\subfloat[]{\includegraphics{SUBFIG33}}\hfill
\subfloat[]{\includegraphics{SUBFIG34}}\hfill
\subfloat[]{\includegraphics{SUBFIG35}}\hfill
\subfloat[]{\includegraphics{SUBFIG36}}

\medskip
\subfloat[]{\includegraphics{SUBFIG37}}\hfill
\subfloat[]{\includegraphics{SUBFIG38}}\hfill
\subfloat[]{\includegraphics{SUBFIG39}}\hfill
\subfloat[]{\includegraphics{SUBFIG40}}

\medskip
\subfloat[]{\includegraphics{SUBFIG41}}\hfill
\subfloat[]{\includegraphics{SUBFIG42}}\hfill
\subfloat[]{\includegraphics{SUBFIG43}}\hfill
\subfloat[]{\includegraphics{SUBFIG44}}

\medskip
\subfloat[]{\includegraphics{SUBFIG45}}\hfill
\subfloat[]{\includegraphics{SUBFIG46}}\hfill
\subfloat[]{\includegraphics{SUBFIG47}}\hfill
\subfloat[]{\includegraphics{SUBFIG48}}

\end{figure}

\begin{figure}[p]
\setkeys{Gin}{width=0.22\textwidth,height=0.125\textheight,keepaspectratio}
\ContinuedFloat
\caption{XXX, continued}

\subfloat[]{\includegraphics{SUBFIG49}}\hfill
\subfloat[]{\includegraphics{SUBFIG50}}\hfill
\subfloat[]{\includegraphics{SUBFIG51}}\hfill
\subfloat[]{\includegraphics{SUBFIG52}}

\medskip
\subfloat[]{\includegraphics{SUBFIG53}}\hfill
\subfloat[]{\includegraphics{SUBFIG54}}\hfill
\subfloat[]{\includegraphics{SUBFIG55}}\hfill
\subfloat[]{\includegraphics{SUBFIG56}}

\medskip
\subfloat[]{\includegraphics{SUBFIG57}}\hfill
\subfloat[]{\includegraphics{SUBFIG58}}\hfill
\subfloat[]{\includegraphics{SUBFIG59}}\hfill
\subfloat[]{\includegraphics{SUBFIG60}}

\medskip
\subfloat[]{\includegraphics{SUBFIG61}}\hfill
\subfloat[]{\includegraphics{SUBFIG62}}\hfill
\subfloat[]{\includegraphics{SUBFIG63}}\hfill
\subfloat[]{\includegraphics{SUBFIG64}}

\medskip
\subfloat[]{\includegraphics{SUBFIG65}}\hfill
\subfloat[]{\includegraphics{SUBFIG66}}\hfill
\subfloat[]{\includegraphics{SUBFIG67}}\hfill
\subfloat[]{\includegraphics{SUBFIG68}}

\medskip
\subfloat[]{\includegraphics{SUBFIG69}}\hfill
\subfloat[]{\includegraphics{SUBFIG70}}\hfill
\subfloat[]{\includegraphics{SUBFIG71}}\hfill
\subfloat[]{\includegraphics{SUBFIG72}}

\end{figure}

\begin{figure}[ht!]
\setkeys{Gin}{width=0.22\textwidth,height=0.125\textheight,keepaspectratio}
\ContinuedFloat
\caption{XXX, continued}

\subfloat[]{\includegraphics{SUBFIG73}}\hfill
\subfloat[]{\includegraphics{SUBFIG74}}\hfill
\subfloat[]{\includegraphics{SUBFIG75}}\hfill
\subfloat[]{\includegraphics{SUBFIG76}}

\medskip
\subfloat[]{\includegraphics{SUBFIG77}}\hfill
\subfloat[]{\includegraphics{SUBFIG78}}\hfill
\subfloat[]{\includegraphics{SUBFIG79}}\hfill
\subfloat[]{\includegraphics{SUBFIG80}}

\medskip
\subfloat[]{\includegraphics{SUBFIG81}}\hfill

\end{figure}


\end{document} 

答案2

也许,如果你把图形放在一个表格中,然后使用 将其拆分到各个页面\ContinuedFloat。虽然,在这种方法中,你必须手动拆分图形,这当然不是很优雅。

\documentclass{scrreprt}
\usepackage{graphicx}
\usepackage{subcaption}

\DeclareCaptionSubType*{figure}\renewcommand\thesubfigure{\arabic{subfigure}}
\newcommand{\sub}[1]{\begin{minipage}{.2\linewidth}\includegraphics[width=\linewidth]{#1}\subcaption{}\end{minipage}}
\newcommand{\tabfig}[4]{\sub{#1} & \sub{#2} & \sub{#3} & \sub{#4}\\}

\begin{document}
\begin{figure}[ht]
   \begin{tabular}{cccc}
       \tabfig{example}{example}{example}{example}
       \tabfig{example}{example}{example}{example}
       \tabfig{example}{example}{example}{example}
       \tabfig{example}{example}{example}{example}
       \tabfig{example}{example}{example}{example}
   \end{tabular}
\end{figure}
\begin{figure}[ht]\ContinuedFloat
   \begin{tabular}{cccc}
       \tabfig{example}{example}{example}{example}
       \tabfig{example}{example}{example}{example}
       \tabfig{example}{example}{example}{example}
       \tabfig{example}{example}{example}{example}
       \tabfig{example}{example}{example}{example}
   \end{tabular}
\end{figure}
\end{document}

相关内容