The following code shows that the tikz "scale" is different from pgf?
Changing the scale values for x and y in the tikzset command will scale the tikz rectangle but not the pgf star. Any ideas how to reconcile this? I need to be able to to scale my tikz pictures easily but have pgf use the same scale and origin.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.callouts,shapes.geometric}
\begin{document}
\tikzset{x=0.1in,y=0.1in}
\begin{tikzpicture}
\draw[top color= black!50] (-2,-2) rectangle (5,4);
\begin{scope}
\pgfset{minimum width=1.5cm,minimum height=1.5cm}
\pgftransformshift{\pgfpoint{2cm}{2cm}}
\pgfnode{star}{center}{}{}{\pgfusepath{clip}}
\pgftransformreset
% Back to drawing
\fill[yellow] (2cm,2cm) circle (0.65cm);
\end{scope}
\end{tikzpicture}
\end{document}
Best Answer
The main difficulty is that the
scale
andtransform shape
keys belong to/tikz/
family and does not penetrate down to PGF level. Instead they are mapped with rather tedious mechanisms. Hence, we need to somewhat fake it with low level transformation commands. If for some reasons we still need to use[x=0.1in,y=0.1in]
we have to add the corresponding\pgfsetxvec
and\pgfsetyvec
commands appropriately to mimic the TikZ effect.