# vertical spacing between subfloat

I am using subfig package. Is it possible to reduce the spacing between two sufloats one below the other? I couldn't find anything in the documentation.

• Just use \\[<negativespace>] after the \subfloat line. By <negativespace> I mean some thing like [-0.5cm] – user11232 Feb 27 '14 at 23:42
• Just to help us help you, could you provide a minimal working example (MWE) that uses example-image for the subfloats? It would really speed up getting solutions your way... in general. – Werner Feb 28 '14 at 0:19

You can use \\[<negativespace>] like \\[-2ex] after the last sub float in the current line.

Some example:

\documentclass{article}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htb]
\subfloat[Some figure]{\includegraphics[width=0.48\textwidth]{example-image-a}}\hfill
\subfloat[Some other figure]{\includegraphics[width=0.48\textwidth]{example-image-b}}\\[-2ex]  %%<-- in this line
\subfloat[Some more]{\includegraphics[width=0.48\textwidth]{example-image-c}}\hfill
\subfloat[Some less]{\includegraphics[width=0.48\textwidth]{example-image}}
\caption{There are example figures}
\end{figure}
\end{document}


• \[negative space] works perfectly – Sandeep Feb 28 '14 at 19:21

Here's a way:

\documentclass{article}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}

\begin{figure}[htb]
\captionsetup[subfloat]{farskip=2pt,captionskip=1pt}
\centering
\subfloat[Some figure]{\includegraphics[width=0.48\textwidth]{example-image-a}}\hfill
\subfloat[Some other figure]{\includegraphics[width=0.48\textwidth]{example-image-b}}

\subfloat[Some more]{\includegraphics[width=0.48\textwidth]{example-image-c}}\hfill
\subfloat[Some less]{\includegraphics[width=0.48\textwidth]{example-image}}

\caption{There are example figures}
\end{figure}
\end{document}


The parameter farskip governs the spacing above and between rows of subfloats; with captionskip we set the distance from the subfigure and the caption. Play with the values; the \captionsetup[subfloat]{...} command can also be given in the preamble and so it will have effect on all subfloats. So, you can have both global and local setting, if necessity arises.