[Tex/LaTex] Specifying the width and height of a tikzpicture


Is it possible to specify the width and height of a tikzpicture? To scale a tikzpicture I use the option scale, i.e. for instance

\begin{tikzpicture}[scale = 2]

I tried to change the width and height as

\begin{tikzpicture}[width = 2in, height = 3in]

but this gives me an error "I do not know the key /tikz/width".

Best Answer


I came back here to add information about the tikzscale package, however I found an answer about that already in this thread. I believe you will want to give it a try.

Use resizebox outside of tikzpicture.


For example:


                \node [draw] (my node 1) {my node 1};
                \node [draw, anchor = west] (my node 2) at (my node 1.east) {centro};
                \node [draw, anchor = west] at (my node 2.east) {my node 3};