Possible Duplicate:
Should I use center or centering for figures and tables?
What is the correct way to cause a \tikzpicture to be centered? By default it appears to be aligned with the left margin.
Possible Duplicate:
Should I use center or centering for figures and tables?
What is the correct way to cause a \tikzpicture to be centered? By default it appears to be aligned with the left margin.
When the picture doesn't need to be put in a figure (i.e. when it doesn't need a caption), I use
\begin{center}
\begin{tikzpicture}
....
\end{tikzpicture}
\end{center}
\begin{figure}[!h]
\centering
\tikz
\end{figure}
figure environment doesn't just center the tikzpicture, it also adds a caption and some vertical spacing, which may not be desired.
– PatrickT
Feb 14 '21 at 05:56
adjustboxpackage:\begin{adjustbox}{center}\begin{tikzpicture}...\end{tikzpicture}\end{adjustbox}– Martin Scharrer Jan 08 '19 at 20:51