[Tex/LaTex] Reduce space between subfigure and the subfigure captions

captionsfloatsspacingsubfloats

How can I reduce the space between subfigure and the sufigure captions ?

Preamble

\usepackage{float}%exact location 
\usepackage{graphicx} 
\usepackage{caption} 
\usepackage{subcaption} % for subfigures

Example.

\begin{figure}[H]
        \centering
        \begin{subfigure}[b]{0.4textwidth}
                \includegraphics[width=\textwidth]{Pictures/pic0.pdf}
                \caption{}
                \label{fig:lab0}
        \end{subfigure}       
        \begin{subfigure}[b]{0.4\textwidth}
                \includegraphics[width=\textwidth]{Pictures/pic1.pdf}
                \caption{}
                \label{fig:lab1}
        \end{subfigure}

        \caption{A long caption}\label{fig:lab} 
\end{figure}

Best Answer

You could just place a \vspace command after the last figure and before the caption:

\documentclass{article}
\usepackage{float}%exact location 
\usepackage{graphicx} 
\usepackage{caption} 
\usepackage{subcaption} % for subfigures

\begin{document}

\begin{figure}[H]
        \centering
        \begin{subfigure}[b]{0.4\textwidth}
                \includegraphics[width=\textwidth]{example-image-a}
                \caption{}
                \label{fig:lab0}
        \end{subfigure}       
        \begin{subfigure}[b]{0.4\textwidth}
                \includegraphics[width=\textwidth]{example-image-b}
                \caption{}
                \label{fig:lab1}
        \end{subfigure}
        \vspace{-2\baselineskip}
        \caption{A long caption}\label{fig:lab} 
\end{figure}

\end{document}

You probably don't want to use the value -2\baselineskip as I have done. I've only done that so you can readily see the effect below:

enter image description here

UPDATE

Per the comments to this post, there is an aboveskip and belowskip option available via the caption package, which is loaded when loading subcaption. This allows you to more conveniently make a change to how the captions are placed.

\documentclass{article}
\usepackage{float}%exact location 
\usepackage{graphicx} 
\usepackage{caption} 
\usepackage{subcaption} % for subfigures

\begin{document}

\begin{figure}[H]
        \captionsetup[subfigure]{aboveskip=-1pt,belowskip=-1pt}
        \centering
        \begin{subfigure}[b]{0.4\textwidth}
                \includegraphics[width=\textwidth]{example-image-a}
                \caption{}
                \label{fig:lab0}
        \end{subfigure}       
        \begin{subfigure}[b]{0.4\textwidth}
                \includegraphics[width=\textwidth]{example-image-b}
                \caption{}
                \label{fig:lab1}
        \end{subfigure}
        \caption{A long caption}\label{fig:lab} 
\end{figure}

\end{document}