6

I'm fairly new to using LaTeX, so don't blame me for asking obvious questions. The ganttchart in the code below will be placed above the section title, and I have no clue why. Any help would be appreciated.

\section{Tables}

\begin{figure}[ftbp]

\begin{ganttchart}[y unit title=0.4cm,
y unit chart=0.5cm,
vgrid,hgrid, 
title label anchor/.style={below=-1.6ex},
title left shift=.05,
title right shift=-.05,
title height=1,
bar/.style={fill=gray!50},
incomplete/.style={fill=white},
progress label text={},
bar height=0.7,
group right shift=0,
group top shift=.6,
group height=.3,
group peaks={}{}{.2}]{20}

\gantttitle{Maand}{20} \\
\gantttitle{Month1}{4} 
\gantttitle{Month2}{4} 
\gantttitle{Month3}{4} 
\gantttitle{Month4}{4} 
\gantttitle{Month5}{4} \\
\ganttbar{Fase1}{1}{3} \\
\ganttbar{Fase2}{4}{5} \\
\ganttbar{Fase3}{6}{7} \\
\ganttbar{Fase4}{8}{16} \\
\ganttbar{Fase5}{17}{20}
\end{ganttchart}

\caption{Planning}
\end{figure}
David Carlisle
  • 757,742
Tomzie
  • 163

1 Answers1

7

There is no problem here, a figure is a float just like a table environment. TeX tries to put it somewhere it thinks it's a nice place to squeeze based on some rules that are a little mysterious. If you put some text between the section and the figure environment you will get different results depending on the text length etc. But mostly it will try to put it on the top of the page.

You can read how this works from our great Frank Mittelbach,

How to influence the position of float environments like figure and table in LaTeX?

percusse
  • 157,807
  • Changing the \begin{figure}[ftbp] into \begin{figure}[h] did it for me. Thanks for your answer. – Tomzie Feb 14 '13 at 14:21