I was wondering which is the correct way to scale a tikzpicture.
I tried with
\begin{tikzpicture}[scale=0.50]
but what I obtain is that distances between elements are scaled but not their sizes or text size too. It's like if the picture collapses on itself, without correctly scaling (as I would imagine, like having a zoom factor)
Am I missing something? Should I use a different command or what?
Best Answer
You could try using the command
\resizebox
. You enclose thetikzpicture
environment in one of those and then in is scaled. Like this:If you want the image to be scaled proportionally, you can give one of the sizes and put
!
in the other. There is also a\scalebox{<factor>}{...}
macro which allows scaling by a factor. This works well except when thetikzpicture
has a matrix command, and the columns are separated by&
, in that case, you can change the column separator using the optionampersand replacement
in the matrix options as stated in thepgfmanual
.Alternatively use the
adjustbox
package which provides anadjustbox
environment which also allows resizing and scaling while allowing for special content including catcode changes required for verbatim text and the aforementioned&
.