Reducing space between caption and figures with \makebox

captionsfloats

I am trying too decrease the space between the captions in the makebox and the figures I am displaying with the following code;

\begin{figure}%
  \centering
   \begin{adjustbox}{minipage=\linewidth,scale=0.9}
\hfil\hfil\includegraphics[width=8cm]{mainmatter/1/Chapter_4/heat_maps/hs4_original_heatmap.pdf}\hfil\hfil
\includegraphics[width=8cm]{mainmatter/1/Chapter_4/heat_maps/hs4_heat_predicted.pdf}\newline
\setlength\parindent{0pt}
   \null\hfil\hfil\makebox[5cm]{Original incidence matrix \protect\linebreak ${\bf M}$.}
  \null\hfil\hfil\makebox[5cm]{Surrogate incidence matrix \protect\linebreak $\hat{\bf M}^{(MC)}$.}
  \caption{Original versus surrogate incidence matrix for the year 2018 at the HS-4 level.}
  \end{adjustbox}
\end{figure}

However the sapce between single captions of the figures and the figures is still large.
How can I decrease it? I tried with \setlength\parindent{0pt} but it does not work…

Best Answer

Breaking lines in boxes created with \makebox is not possible.

The code is really clumsy, I'm afraid, and uses undocumented commands such as \null. I see no reason for adjustbox either.

Based on the template we discussed in a previous post of yours, here's the output from your code:

enter image description here

With the following much simpler code

\begin{figure}[!htp]
\centering
\renewcommand{\arraystretch}{0.5}% to countermand double spacing

\begin{tabular}{ @{} c c @{} }
\includegraphics[width=7.2cm]{example-image} &
\includegraphics[width=7.2cm]{example-image} \\
Original incidence matrix $\mathbf{M}$ &
Surrogate incidence matrix $\hat{\mathbf{M}}^{(\mathrm{MC})}$
\end{tabular}

\caption{Original versus surrogate incidence matrix for the year 2018 at the HS-4 level.}
\end{figure}

you get

enter image description here

Please, remember that \bf has been a deprecated command since before you were born (judging from you writing a PhD thesis).

Related Question