[Tex/LaTex] How to control the size of the figure

tikz-pgf

Without using the include graphic, placing directly within the text a design using TikZ, you can control the size of the figure?

Best Answer

Use the scale-Option, such as

\begin{tikzpicture}[scale=0.5]
...
\end{tikzpicture}

or the short syntax, which is convenient for small images within text:

\tikz[scale=0.5]

To apply that scaling also to contained shapes, you may want to add the corresponding option:

\begin{tikzpicture}[scale=0.5, transform shape]
...
\end{tikzpicture}

As cfr already commented, you can use the LaTeX scaling tools, such as \scalebox and \resizebox. Both have the advantage of scaling all easily, but note that scaling fonts is not so good compared to directly using the font in a certain size. With \resizebox you can directly specify the desired size instead of a scaling factor.

\resizebox{width}{height}{%
  \begin{tikzpicture}
    ...
  \end{tikzpicture}
}