Below are two TikZ pictures. In the second one, I've added a \scalebox
to scale the nodes ABC and the distance between them. I want the A to remain in the same position, but unfortunately the coordinates are scaled with respect to origin.
How can I rescale that part of the figure without translating it?
MWE for the picture with a scalebox:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node at (0,0) {0,0};
\node at (4,4) {4,4};
\node at (0,4) {0,4};
\node at (4,0) {4,0};
\scalebox{0.67}{
\node at (2,2) (A) {A};
\node [right=of A] {B};
\node [below=of A] {C};
}
\end{tikzpicture}
\end{document}
To be clear: I do want the distances between A, B and C to scale, I just don't want the entire scalebox to move towards origin. In my actual document, the contents of the scalebox are more complicated.
Best Answer
Use a
scope
with optionsscale=0.67
andtransform shape
instead of the\scalebox
. All numeric coordinates inside the scope will be scaled. But you can use an outside thescope
defined namedcoordinate
as "anchor" to position the nodeA
.