0

i have a tabu and a subfloat in a figure function block. how do i reduce the spacing between the tabu and subfloat ? below is my code and figure. i would like a simple solution that does not require me to restructure my code. i want to reduce gap between x1 x2 x3 etc and the subfloat below it

\begin{figure}
\captionsetup[subfigure]{labelformat=empty}
    \centering
    {\scriptsize
    \begin{tabu} to \textwidth { XXXXXXXXXXXXXXXXXXXX }
    $x_1$ & $x_2$ & $x_3$ & $x_4$ & $x_5$ & $x_6$ & $x_7$ & $x_8$ & $x_9$ & $x_{10}$ & $x_{11}$ & $x_{12}$ & $x_{13}$ & $x_{14}$ & $x_{15}$ & $x_{16}$ & $x_{17}$ & $x_{18}$ & $x_{19}$ & $x_{20}$ \end{tabu}
    } \vspace*{-5mm} %%% HERE %%%%%%
    \subfloat[Ground Truth]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-gt.png} }}
    \\ 
    \subfloat[Recurrent Neural Network]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-rnn.png} }}
    \\ 
    \subfloat[Variational Recurrent Neural Network]{{\includegraphics[width=\textwidth]{ood-ms/ood-1-vrnn.png} }}
    \\ \noindent\rule{15cm}{0.4pt}
    \subfloat[Ground Truth]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-gt.png} }}
    \\ 
    \subfloat[Recurrent Neural Network]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-rnn.png} }}
    \\ 
    \subfloat[Variational Recurrent Neural Network]{{\includegraphics[width=\textwidth]{ood-ms/ood-3-vrnn.png} }}
    \\ \noindent\rule{15cm}{0.4pt}
    \caption{Out of domain runs for (top) 1 shape and (bottom) 3 shapes on the moving shapes dataset. The model received the ground truth as input for the first
20 timesteps.}
    \label{fig:ood-ms}
\end{figure}

enter image description here

  • you can just insert some negative vertical space with e.g. \vspace{-1em} between the two. – Michael Palmer Jan 12 '18 at 1:06
  • please extend your code sniped to complete small document beginning with \documentclass{...} and ending by \end{document}, that we can see how can we help you. see edit of my answer on your previous question (tex.stackexchange.com/questions/409959/…). there vertical space doesn't seems to be so big. – Zarko Jan 12 '18 at 1:38
1

edit: it seems that table introduce additional vertical space between table and sub captions. this can be reduced by adding negative vertical space before end of table:

...
\vspace*{-3pt}%
\end{tabu}}

modified my answer to use of tabu instead of tabularx table:

 \documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage[demo]{graphicx}
\usepackage{tabu}
\usepackage{subfig}

\begin{document}
    \begin{figure}
    \centering
\captionsetup[subfigure]{labelformat=empty}
\subfloat[ sub caption text]{% <--- had to be here
    \setlength\tabcolsep{0pt}% <--- had to be here
\begin{tabu} to \textwidth {*{11}{X[c,$]}}
\alpha=0 & \alpha=1 & \alpha=2 & \alpha=3 & \alpha=4 & \alpha=5 
         & \alpha=6 & \alpha=7 & \alpha=8 & \alpha=9 & \alpha=10    \\
\multicolumn{11}{c}{\includegraphics[width=\textwidth]{latent/latent-interpolation.png} }
\vspace*{-3pt}%
\end{tabu}}

\subfloat[ sub caption text]%
{\includegraphics[width=\textwidth]{latent/latent-interpolation.png}}
\caption{Interpolating between random pairs of latent vectors according to $v = v_1 + (v_2 - v_1) \times \alpha$.}
\label{fig:interpolate-latent}
    \end{figure}
\end{document}

enter image description here

to my opinion spaces between subfloats are appropriate big.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.