I have made a figure using TikZ and I want it to be inside a subsection after a few sentences, as shown in the following:
\newpage
\section{Modeling}
\subsection{Modeling Trajectory}
This subsection's content...
at this point I will....
\begin{figure}
\begin{center}
\begin{tikzpicture}
\draw[thick,->] (0,0) -- (6,0) node[anchor=north west] {x};
\draw[thick,->] (0,0) -- (0,6) node[anchor=south east] {y};
\draw[thick,->] (3,3) -- (5,2) node[anchor=north west] {$V_{T}$};
\draw[thick,->] (3,3) -- (1,4) node[anchor=south west] {$F_{Drag}$};
\draw[thick,->] (3,3) -- (3,1) node[anchor=north west] {g};
\draw [dashed] (3,3) -- (6,3);
\draw (4,3) arc (0:-28:1) node[] at (30:5.3) {$\gamma_{T}$};
\end{tikzpicture}
\caption{Ballistic target geometry}
\end{center}
\end{figure}
However, what I get is that the figure at the top of the page, then the section title and the the subsection title.
The result I needed is:
section title
subsection title
figure
I tried using \floatbarrier but it moves the whole figure to the center of other page.
Thank you.

centerenv to center, bothcenterandfigureintroduces vertical space. (2) use\begin{figure}[htbp]note the extra option. The default istbpthus no 'here about', that extra'h' is important. (3) Using theH` is almost never a good solution as floats and end in the wrong over. – daleif May 19 '17 at 11:41