[Tex/LaTex] Reduce space between subfigure and captions

subcaption

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]

PICTURE is added.

enter image description here

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.
enter image description here

Best Answer

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:

enter image description here

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.