如何设置图形之间的最小边距?

如何设置图形之间的最小边距?

这是我的设置

\begin{figure*}[t]  
 \begin{minipage}{.24\textwidth}        
 \centering         
 \includegraphics[width=1\textwidth, height=3.cm]{figs/1.png}   
 \subcaption{}      
 \label{1}  
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/2.png}   
 \subcaption{}  \label{fig:a} 
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/3.png}  
 \subcaption{}  
 \label{2} 
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}        
 \centering         
 \includegraphics[width=1\textwidth, height=3.cm]{figs/4.png}       
 \subcaption{}      
 \label{fig:b}  
 \end{minipage}\\[\baselineskip]    
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/5.png}  
 \subcaption{}  
 \label{3} 
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/6.png}   
 \subcaption{}  
 \label{fig:c} 
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}        
 \centering         
 \includegraphics[width=1\textwidth, height=3.cm]{figs/7.png} 
 \subcaption{}      
 \label{4}  
 \end{minipage}
 \hfill     
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/8.png}   
 \subcaption{}  
 \label{fig:d} 
 \end{minipage}\\[\baselineskip]    
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/9.png}  
 \subcaption{}  
 \label{5} 
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}        
 \centering         
 \includegraphics[width=1\textwidth, height=3.cm]{figs/10.png}          
 \subcaption{}      
 \label{fig:e}  
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/11.png} 
 \subcaption{}  
 \label{6} 
 \end{minipage}
 \hfill     
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/12.png}      
 \subcaption{}  
 \label{fig:f} 
 \end{minipage}\\[\baselineskip]    
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/13.png} 
 \subcaption{}  
 \label{7} 
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}        
 \centering         
 \includegraphics[width=1\textwidth, height=3.cm]{figs/14.png}          
 \subcaption{}      
 \label{fig:g}  
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/15.png} 
 \subcaption{}  
 \label{8} 
 \end{minipage}\hfill   
 \begin{minipage}{.24\textwidth}    
 \centering     
 \includegraphics[width=1\textwidth, height=3.cm]{figs/16.png}      
 \subcaption{}  
 \label{fig:h} 
 \end{minipage}     
 \caption{Snapshots.}       
 \label{fig:snap} 
\end{figure*}

在此处输入图片描述

答案1

看来您正在使用该subcaption包。如果是这样,您可以通过适当的\captionsetup指令减少图形和子标题之间的垂直距离,如下例所示。

我还将minipage用环境替换 16 个subfigure环境。这样做可以更好地使用\caption\captionsetup指​​令。

在此处输入图片描述

\documentclass[twocolumn]{article}
\usepackage[demo]{graphicx} % remove 'demo' option in real document

\usepackage{subcaption}
\captionsetup[figure]{skip=0.333\baselineskip} 
\captionsetup[subfigure]{skip=0.1\baselineskip} % default is '1\baselineskip'

\begin{document}
\begin{figure*}[t]  
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/1.png}
      \caption{}\label{1}   
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}    
      \includegraphics[width=1\textwidth, height=3cm]{figs/2.png}   
      \caption{}\label{fig:a} 
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/3.png}
      \caption{}\label{2} 
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}        
      \includegraphics[width=1\textwidth, height=3cm]{figs/4.png} 
      \caption{}\label{fig:b}   
    \end{subfigure}
    
    \medskip % or, \bigskip if you want more vertical whitespace
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/5.png}
      \caption{}\label{3} 
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/6.png}   
      \caption{}\label{fig:c} 
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}        
      \includegraphics[width=1\textwidth, height=3cm]{figs/7.png}
      \caption{}\label{4}   
    \end{subfigure}
    \hfill  
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/8.png}   
      \caption{}\label{fig:d} 
    \end{subfigure}
        
    \medskip % or, \bigskip if you want more vertical whitespace
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/9.png}
      \caption{}\label{5} 
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}        
      \includegraphics[width=1\textwidth, height=3cm]{figs/10.png} 
      \caption{}\label{fig:e}   
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/11.png}
      \caption{}\label{6} 
    \end{subfigure}
    \hfill  
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/12.png}      
      \caption{}\label{fig:f} 
    \end{subfigure}
    
    \medskip % or, \bigskip if you want more vertical whitespace
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/13.png}
      \caption{}\label{7} 
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}        
      \includegraphics[width=1\textwidth, height=3cm]{figs/14.png} 
      \caption{}\label{fig:g}   
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/15.png}
      \caption{}\label{8} 
    \end{subfigure}\hfill   
    \begin{subfigure}{.24\textwidth}
      \includegraphics[width=1\textwidth, height=3cm]{figs/16.png}      
      \caption{}\label{fig:h} 
    \end{subfigure}     
\caption{Snapshots.}
\label{fig:snap} 
\end{figure*}
\end{document}

附录:要将图形对放入subfigure环境中,每个只需提供 2 个\includegraphics语句subfigure

在此处输入图片描述

\documentclass[twocolumn]{article}
\usepackage[demo]{graphicx} % remove 'demo' option in real document

\usepackage{subcaption}
\captionsetup[figure]{skip=0.333\baselineskip}
\captionsetup[subfigure]{skip=0.2\baselineskip}

\begin{document}
\begin{figure*}
    \begin{subfigure}{.48\textwidth}
      \includegraphics[width=0.475\textwidth, height=3cm]{figs/1.png}%
      \hfill
      \includegraphics[width=0.48\textwidth, height=3cm]{figs/2.png}    
      \caption{\dots}\label{fig:a} 
    \end{subfigure}\hfill   
    \begin{subfigure}{.48\textwidth}
      \includegraphics[width=0.475\textwidth, height=3cm]{figs/3.png}%
      \hfill    
      \includegraphics[width=0.475\textwidth, height=3cm]{figs/4.png} 
      \caption{\dots}\label{fig:b}  
    \end{subfigure}
    
    \medskip % or, \bigskip if you want more vertical whitespace
    \begin{subfigure}{.48\textwidth}
      \includegraphics[width=.475\textwidth, height=3cm]{figs/5.png}%
      \hfill
      \includegraphics[width=.475\textwidth, height=3cm]{figs/6.png}    
      \caption{\dots}\label{fig:c} 
    \end{subfigure}\hfill   
    \begin{subfigure}{.48\textwidth}        
      \includegraphics[width=.475\textwidth, height=3cm]{figs/7.png}%
      \hfill
      \includegraphics[width=.475\textwidth, height=3cm]{figs/8.png}    
      \caption{\dots}\label{fig:d} 
    \end{subfigure}
        
    \medskip % or, \bigskip if you want more vertical whitespace
    \begin{subfigure}{.48\textwidth}
      \includegraphics[width=.475\textwidth, height=3cm]{figs/9.png}%
      \hfill        
      \includegraphics[width=.475\textwidth, height=3cm]{figs/10.png} 
      \caption{\dots}\label{fig:e}  
    \end{subfigure}\hfill   
    \begin{subfigure}{.48\textwidth}
      \includegraphics[width=.475\textwidth, height=3cm]{figs/11.png}%
      \hfill
      \includegraphics[width=.475\textwidth, height=3cm]{figs/12.png}   
      \caption{\dots}\label{fig:f} 
    \end{subfigure}
    
    \medskip % or, \bigskip if you want more vertical whitespace
    \begin{subfigure}{.48\textwidth}
      \includegraphics[width=.475\textwidth, height=3cm]{figs/13.png}%
      \hfill        
      \includegraphics[width=.475\textwidth, height=3cm]{figs/14.png} 
      \caption{\dots}\label{fig:g}  
    \end{subfigure}\hfill   
    \begin{subfigure}{.48\textwidth}
      \includegraphics[width=.475\textwidth, height=3cm]{figs/15.png}%
      \hfill
      \includegraphics[width=.475\textwidth, height=3cm]{figs/16.png}   
      \caption{\dots}\label{fig:h} 
    \end{subfigure}     
\caption{Snapshots.}
\label{fig:snap} 
\end{figure*}
\end{document}

答案2

用空行替换\\[baselineskip]已经大大减少了子标题下方的空间。如果您希望子标题上方和下方的空间更小,您可以使用和调整和\captionsetup[subfigure]的值以满足您的需求:aboveskipbelowskip

在此处输入图片描述

\documentclass[twocolumn]{article}
\usepackage{subcaption}
\usepackage[demo]{graphicx}


\begin{document}

\begin{figure*}[t] 
 \begin{subfigure}[t]{.24\textwidth}                
      \includegraphics[width=1\textwidth, height=3.cm]{figs/1.png}     
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/2.png}   
    \subcaption{}  
    \label{fig:a} 
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}       
    \includegraphics[width=1\textwidth, height=3.cm]{figs/3.png}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}               
    \includegraphics[width=1\textwidth, height=3.cm]{figs/4.png}       
    \subcaption{}      
    \label{fig:b}  
  \end{subfigure}
    
  \begin{subfigure}[t]{.24\textwidth}      
    \includegraphics[width=1\textwidth, height=3.cm]{figs/5.png}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}      
    \includegraphics[width=1\textwidth, height=3.cm]{figs/6.png}   
    \subcaption{}  
    \label{fig:c} 
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}             
    \includegraphics[width=1\textwidth, height=3.cm]{figs/7.png} 
  \end{subfigure}\hfill     
  \begin{subfigure}[t]{.24\textwidth}        
    \includegraphics[width=1\textwidth, height=3.cm]{figs/8.png}   
    \subcaption{}  
    \label{fig:d} 
  \end{subfigure}
  
  \begin{subfigure}[t]{.24\textwidth}     
    \includegraphics[width=1\textwidth, height=3.cm]{figs/9.png}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}              
    \includegraphics[width=1\textwidth, height=3.cm]{figs/10.png}          
    \subcaption{}      
    \label{fig:e}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}       
    \includegraphics[width=1\textwidth, height=3.cm]{figs/11.png} 
  \end{subfigure}\hfill     
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/12.png}      
    \subcaption{}  
    \label{fig:f} 
  \end{subfigure}
   
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/13.png}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}                
    \includegraphics[width=1\textwidth, height=3.cm]{figs/14.png}          
    \subcaption{}      
    \label{fig:g}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/15.png} 
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/16.png}      
    \subcaption{}  
    \label{fig:h} 
  \end{subfigure}     
  \caption{Snapshots.}       
  \label{fig:snap} 
\end{figure*}

\begin{figure*}[t] 
\captionsetup[subfigure]{aboveskip=0pt,belowskip=0pt}  
 \begin{subfigure}[t]{.24\textwidth}                
      \includegraphics[width=1\textwidth, height=3.cm]{figs/1.png}     
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/2.png}   
    \subcaption{}  
    \label{fig:a} 
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}       
    \includegraphics[width=1\textwidth, height=3.cm]{figs/3.png}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}               
    \includegraphics[width=1\textwidth, height=3.cm]{figs/4.png}       
    \subcaption{}      
    \label{fig:b}  
  \end{subfigure}
    
  \begin{subfigure}[t]{.24\textwidth}      
    \includegraphics[width=1\textwidth, height=3.cm]{figs/5.png}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}      
    \includegraphics[width=1\textwidth, height=3.cm]{figs/6.png}   
    \subcaption{}  
    \label{fig:c} 
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}             
    \includegraphics[width=1\textwidth, height=3.cm]{figs/7.png} 
  \end{subfigure}\hfill     
  \begin{subfigure}[t]{.24\textwidth}        
    \includegraphics[width=1\textwidth, height=3.cm]{figs/8.png}   
    \subcaption{}  
    \label{fig:d} 
  \end{subfigure}
  
  \begin{subfigure}[t]{.24\textwidth}     
    \includegraphics[width=1\textwidth, height=3.cm]{figs/9.png}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}              
    \includegraphics[width=1\textwidth, height=3.cm]{figs/10.png}          
    \subcaption{}      
    \label{fig:e}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}       
    \includegraphics[width=1\textwidth, height=3.cm]{figs/11.png} 
  \end{subfigure}\hfill     
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/12.png}      
    \subcaption{}  
    \label{fig:f} 
  \end{subfigure}
   
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/13.png}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}                
    \includegraphics[width=1\textwidth, height=3.cm]{figs/14.png}          
    \subcaption{}      
    \label{fig:g}  
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/15.png} 
  \end{subfigure}\hfill   
  \begin{subfigure}[t]{.24\textwidth}         
    \includegraphics[width=1\textwidth, height=3.cm]{figs/16.png}      
    \subcaption{}  
    \label{fig:h} 
  \end{subfigure}     
  \caption{Snapshots.}       
  \label{fig:snap} 
\end{figure*}

\end{document}

相关内容