Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
What an obvious question!! :P Welcome to TeX.SE! –  percusse Feb 14 '13 at 14:04
    
Thanks. Got some advice? –  Tomzie Feb 14 '13 at 14:09
add comment

marked as duplicate by lockstep, egreg, Claudio Fiandrino, Thorsten, Kurt Feb 14 '13 at 15:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 6 down vote accepted

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?

share|improve this answer
    
Changing the \begin{figure}[ftbp] into \begin{figure}[h] did it for me. Thanks for your answer. –  Tomzie Feb 14 '13 at 14:21
add comment

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