\begin{figure}[!h]
\centering
\captionsetup{justification=centering}
\begin{tikzpicture}
\draw (0,0) -- (0,2) -- (2,2) -- (2,0) -- (0,0); 
\end{tikzpicture}
\caption{Le premier exemple TikZ}
\label{fig:exemple_tikz2}
\end{figure}