减少子浮动和子标题之间的间隙

减少子浮动和子标题之间的间隙

如何减少子浮动和其标题之间的间隙?我尝试使用

\captionsetup[subfigure]{aboveskip=0pt} 

但它对我不起作用。下面是我的代码片段和输出

\begin{figure}
\captionsetup[subfigure]{labelformat=empty}
\captionsetup[subfigure]{aboveskip=0pt}
    \centering
    \subfloat[Ground Truth]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-gt.png} }}
    \\ \vspace{-1\baselineskip}
    \subfloat[Recurrent Neural Network]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-rnn.png} }}
    \\ \vspace{-1\baselineskip}
    \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-vrnn.png} }}
    \\ \vspace{-0.5\baselineskip} \noindent\rule{14cm}{0.4pt}
    \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-gt.png} }}
    \\ \vspace{-1\baselineskip}
    \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-rnn.png} }}
    \\ \vspace{-1\baselineskip}
    \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-vrnn.png} }}
    \\ \vspace{-0.5\baselineskip} \noindent\rule{14cm}{0.4pt}
        \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-gt.png} }}
    \\ \vspace{-1\baselineskip}
    \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-rnn.png} }}
    \\ \vspace{-1\baselineskip}
    \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-vrnn.png} }}
    \\ \vspace{-0.5\baselineskip} \noindent\rule{14cm}{0.4pt}
    \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-gt.png} }}
    \\ \vspace{-1\baselineskip}
    \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-rnn.png} }}
    \\ \vspace{-1\baselineskip}
    \subfloat[]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-vrnn.png} }}
    \\ \vspace{-1\baselineskip}
    \caption{}
    \label{fig:ms}
\end{figure}

输出如下

在此处输入图片描述

答案1

像这样?

在此处输入图片描述

我宁愿使用来自包的\subfloat环境而不是来自包的环境,并且对于规则使用来自包的:subfigtabular\midrulebooktabs

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{booktabs}

%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\begin{figure}[p]
\newcommand\insertimage[1]{\includegraphics[width=\textwidth,height=13mm]{#1}}
    \centering
\begin{tabular*}{\textwidth}{@{}c@{}}
\insertimage{ood-ms/ood-1-gt.png}       \\
    Ground Truth                        \\
\insertimage{ood-ms/ood-1-rnn.png}      \\
    Recurrent Neural Network            \\
\insertimage{ood-ms/ood-1-vrnn.png}     \\
    \midrule
    \addlinespace
\insertimage{ood-ms/ood-3-gt.png}       \\
\insertimage{ood-ms/ood-3-rnn.png}      \\
\insertimage{ood-ms/ood-3-vrnn.png}     \\
    \midrule
    \addlinespace
\insertimage{ood-ms/ood-1-gt.png}       \\
\insertimage{ood-ms/ood-1-rnn.png}      \\
\insertimage{ood-ms/ood-1-vrnn.png}     \\
    \midrule
    \addlinespace
\insertimage{ood-ms/ood-3-gt.png}       \\
\insertimage{ood-ms/ood-3-rnn.png}      \\
\insertimage{ood-ms/ood-3-vrnn.png}
    \end{tabular*}
\caption{}
    \label{fig:ms}
\end{figure}
\end{document}

相关内容