0

My aim is to increase or decrease the vertical spacing between figures inside the same figure environment. I have tried the subcaptions package and the commands vspace and vspace*, but they did not work. A working example follows below(I included all of the preamble):

\documentclass[12pt,oneside,notitlepage,abstracton,a4paper,demo]{scrartcl} %Draft mode for seeing overflow, underflow
%\documentclass[draft]{article} % Familiar old article class
\usepackage[utf8]{inputenc} % Encoding
\usepackage{epsfig}
\usepackage{scrpage2}
\usepackage{graphicx}
\usepackage[usenames, dvipsnames]{color}
\usepackage[linkcolor=blue, citecolor=red, urlcolor=blue]{hyperref} %References inside the document
\usepackage{hypcap} % Right anchoring for floats
\usepackage{siunitx} % SI units
\usepackage{amsmath, amsfonts, amssymb} % American Mathematical Society 
\usepackage[english]{babel} 
\usepackage[nottoc]{tocbibind}
\usepackage[tmargin=2.5cm, bmargin=2.5cm, lmargin=2.5cm, rmargin=2.5cm]{geometry}
\usepackage{float}
\usepackage{morefloats}
\usepackage{subfigure}
\usepackage{subfigure}
\usepackage{mathrsfs}
\usepackage{xfrac}
\usepackage{needspace} 
\usepackage{wrapfig} % Wrapping figure, tables around text
\usepackage{cancel} % MET E in this case
\usepackage{multirow} % Table entries spanning multiple rows/columns
\usepackage{booktabs}
\usepackage{rotating} % For sideways environment
\hypersetup{colorlinks=true}
%\geometry{tmargin=2.5cm, bmargin=2.5cm, lmargin=2.5cm, rmargin=2.5cm}
\setcounter{secnumdepth}{3}
\setlength{\parindent}{0em}
\setlength{\parskip}{0ex plus0.5ex minus0ex}
\pagestyle{scrheadings}
\bibliographystyle{unsrt}   
\renewcommand{\headfont}{\normalfont}
\cfoot{\pagemark}
\begin{document}
\begin{figure}[H]
    \centering
    \subfigure{\includegraphics[width=.45\textwidth]{300PLOTS50/CF.png}}
    \subfigure{\includegraphics[width=.45\textwidth]{300PLOTS140/CF.png}}
    %vspace does not work here
    \subfigure{\includegraphics[width=.45\textwidth]{300PLOTS50/hNlep.png}}
    \subfigure{\includegraphics[width=.45\textwidth]{300PLOTS140/hNlep.png}}
\end{figure}
%vspace works here
\begin{figure}[H]
    \centering
    \includegraphics[width=.45\textwidth]{300PLOTS50/CF.png}
    \includegraphics[width=.45\textwidth]{300PLOTS140/CF.png}
    \includegraphics[width=.45\textwidth]{300PLOTS50/hNlep.png}
    \includegraphics[width=.45\textwidth]{300PLOTS140/hNlep.png}
\end{figure}
\end{document}
3
  • Some suggestions: (1) There's no need to load a package more than once; (2) Typically one should load hyperref last; (3) subfigure is deprecated; use subcaption instead; (4) Same goes for epsfig. – Werner Sep 9 '14 at 23:27
  • @Werner Okay I will take your suggestions into account, and loading the subfigure two times was a typo. – Vesnog Sep 9 '14 at 23:30
  • @Werner It works but is there a solution involving less typing? I have too many figures to implement inside the document. – Vesnog Sep 9 '14 at 23:38
1

You do not have a paragraph break for the spacing. How does the below work?

\begin{centering}
    \subfigure{\includegraphics[width=.45\textwidth]{300PLOTS50/CF.png}}
    \subfigure{\includegraphics[width=.45\textwidth]{300PLOTS140/CF.png}}\\
  \vspace*{1cm}
    \subfigure{\includegraphics[width=.45\textwidth]{300PLOTS50/hNlep.png}}
    \subfigure{\includegraphics[width=.45\textwidth]{300PLOTS140/hNlep.png}}
\end{centering`}
3
  • Thanks it worked, this is the solution I was seeking. Can you also explain why this works? – Vesnog Sep 10 '14 at 9:08
  • I glad it worked. Don't take this as authoritative, I'm partially guessing. That said, it appears your original layout had all four figures in the one paragraph, sort of acting like words in a paragraph. You can't put vertical space between words. By breaking them, you have a place where you can add vertical space. – Nigel Sep 10 '14 at 9:10
  • Okay thanks for that, and I guess that if I want to use captions for the figures I need to use the subcaption package together with the subfigure environment inside a figure environment`. I tried putting captions inside paragraph boxes, but they were not aligned with the graphics. – Vesnog Sep 10 '14 at 9:41

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.