Graphics, Figures & TablesWhite space above images

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
KBriggs
Posts: 4
Joined: Tue Mar 15, 2011 7:32 pm

White space above images

Post by KBriggs »

Hello all,

I am using subfig to put several images together. However, I am getting an enormous amount of whitespace above the image. It seems to be getting moved to the bottom of the page, which is fine, but the space above it is not being filled.

Here is a minimal example:

Code: Select all

\documentclass[a4paper,12pt]{article} %
\usepackage{graphicx} %
\usepackage{subfig} %
\begin{document}

\begin{figure}
  \centering
  \subfloat[]{\includegraphics[width=0.5\textwidth]{images/image1.png}}
  \subfloat[]{\includegraphics[width=0.5\textwidth]{images/image2.png}} \\
  \noindent
  \subfloat[]{\includegraphics[width=0.5\textwidth]{images/image3.png}}
  \subfloat[]{\includegraphics[width=0.5\textwidth]{images/image4.png}}
  \caption{bla bla}
  \label{image}
\end{figure}

\end{document}
Could anyone point me in the right direction? Ideally, I would like maybe a centimeter or two of whitespace above and below the compound image, but not much more than that.
Last edited by KBriggs on Wed Apr 13, 2011 7:49 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

White space above images

Post by Stefan Kottwitz »

Hi KBriggs,

you should use placement options for your figure environment, such as

Code: Select all

\begin{figure}[!htbp]
...
\end{figure}
Those options are explained here.

Omit the b option if you dont want the figure to appear at the bottom.

Stefan
LaTeX.org admin
KBriggs
Posts: 4
Joined: Tue Mar 15, 2011 7:32 pm

Re: White space above images

Post by KBriggs »

Much better, thanks very much :)!
Post Reply