# Reduce space between subfigure and captions

I know this question has been answered but none of those answers worked for me. I need to decrease the space between subcaption and subfigures.

    [![\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{caption}
\usepackage{float}
\usepackage{anysize}  % for page margins
\marginsize{2cm}{2cm}{2cm}{2cm}

\begin{document}
\begin{figure}$htb$
\centering
\subfloat$FIGURE A${\includegraphics$width=3.5in${LRatio}}\hspace{-3em}
\subfloat$FIGURE B${\includegraphics$width=3.5in${LR_g}}\\$-2ex$
\vspace{-2\baselineskip}
\label{LR}
\caption{Figure2}
\end{figure}

\end{document}][2]][2]


Could you please give me some idea how to decrease the space?

USING \FBOX:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{caption}
\usepackage{float}
\usepackage{anysize}  % for page margins
\marginsize{2cm}{2cm}{2cm}{2cm}

\begin{document}
\begin{figure}[htb]
\centering
\subfloat[FIGURE A]{\fbox{\includegraphics[width=3in]{LRatio}}}\hspace{-3em}
\subfloat[FIGURE B]{\fbox{\includegraphics[width=3in]{LR_g}}} \\[-2ex]
\vspace{-2\baselineskip}
\label{LR}
\caption{Figure2}
\end{figure}

\end{document}]


Here is the output.

• Welcome to SE. In normal circumstance the space between figure and captions is small (6pt, if my memory serves me) , so try to see your image in some viewer, if they have white border below picture. Or if they was drawn with TikZ, where is their bounding box. – Zarko Mar 30 '16 at 23:12
• Added image wasn't generated with given code (even corrected one) in your question. Please, provide complete document, which show what is your problem. In it, please use example-image from graphicx package, which is accessible to anyone. Consider answer and comments to it in link, which you provide. By the way, labels should be always after caption. – Zarko Mar 31 '16 at 4:22
• @zarko I corrected the code above and I posted below just to show you how figures look like with your code. – Demet Mar 31 '16 at 23:52
• @zarko I added the output using \fbox above. – Demet Apr 2 '16 at 23:11
• As I suspect, you have problem with images. They have large white border around theirs content. You need to trim them to right size. In one my answer on similar problem I show how to do this, but unfortunately I don't remember when. Search on SE. – Zarko Apr 2 '16 at 23:18

As you stated in your question, it is duplicate to question for which you provide link. There are in comments to answer given enough instruction, how to manged your problem.

Since this not work for you (as you stated in your question), then see, how you set up your images. There (regarding to first MWE version) you strange use horzintal space coreciton, than also in new version, you require new (empty) line ater sub images. This are distracting to normal figure setting in document. Tray to rewrote your code as you see in MWE below. The result should be satisfactory.

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{caption}

\begin{document}
With local caption setup:
\begin{figure}[htb]
\captionsetup{aboveskip=0pt}
\centering
\subfloat[ test A]{\includegraphics[width=2in]{example-image-a}}
\hfill
\subfloat[ test B]{\includegraphics[width=2in]{example-image-b}}
\caption{Credit Risks}
\label{CR}
\end{figure}

Without local caption setup:

\begin{figure}[htb]
\centering
\subfloat[ test A]{\includegraphics[width=2in]{example-image-a}}
\hfill
\subfloat[ test B]{\includegraphics[width=2in]{example-image-b}}
\caption{Credit Risks}
\label{CR}
\end{figure}
\end{document}


This MWE gives:

If you like to have local settings in the first figure, just move it to preamble of document. Let be noted, in above example the subcations are short in consequently gives filing of big vertical space between them and main captions. This optical illusion go away, if the subcaption text has width of subfigure.

@Zarko Even though your code is just repetition of my code, my figures don't look like yours.

This is how it looks like with your code.

• Than you have problem with images. They have huge white border (otherwise the horizontal distance would be fare more smaller). For any further help I need your pictures that I can make test with them. – Zarko Mar 31 '16 at 23:59
• To see, where the border of your pictures actually are, put them in \fbox. – Zarko Apr 1 '16 at 0:10