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.

unfortunately that does not scale the node text by itself...
–
UiyApr 27 '12 at 20:43

1

Your star is a node. Generally, nodes don't scale with TikZ - you have to explicitly tell them to do so. You're mixing TikZ and PGF commands which might mess things up a little, though, so there might be more to it than that. If you used pure TikZ I'd say you should put the transform shape key on the node command.
–
Loop SpaceApr 27 '12 at 20:43

@AndrewStacey Ok, that works. Another problem now is that my tikzpictures do not all have the same scale. The first one is larger than the others on these same page. I had no scaling issues using tikzset.
–
UiyApr 27 '12 at 20:51

1 Answer
1

The main difficulty is that the scale and transform 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.

I'm still having issues with the scaling. Add/modify your code to use \begin{tikzpicture}[scale=.35, transform shape] \tikzset{x=1in,y=1in} \makeatletter\pgfsys@transformxyscale{0.35}{0.35}... All I'm trying to do now is get the tikz scaling that I'm using to match with the pgf scaling.
–
UiyApr 28 '12 at 23:22

If you do not use the tikzset line then the tikz scale in tikzpicture is not overridden by the pgf scale. It seems they are interacting insome weird or unexpected way. Also I guess I do not understand what the tikzset is actually doing... Seems like it is actually just shifting the origin than anything.
–
UiyApr 28 '12 at 23:27

ok, what it seems like is some scale factor difference. I took out the scale factor from the tikzpicture and used only the makeat one. The scale factor then is applied globally and each new picture environment is scaled repeatedly(so each new picture is scaled down by another extra factor). Should be easy to fix by saving the transform and restoring. BUT all the pgf code in the setclip lua function seems to be using a different scaling factor as it maps to the data exactly if shrunk. This could have to do with the dimension/units issue.
–
UiyApr 28 '12 at 23:32

The problem is, I can't seem to scale just one or the other to get them to match. I think it is the pgfsys transform that I'm using as it is messing up tikz. (I might need to use it outside the tikz frame or calculate my own scaling factors instead of using it in setclip)
–
UiyApr 28 '12 at 23:35

Multiplying the pgf coordinates(the x and y in setclip) by 1/2.54 fixes the problem. I guess the pgf dimensions are in cm by default and I'm using inches in my tikz code. (since my engineering drawings are in inches) This gets everything aligned and properly clipped like it is suppose to be. I'll have to play around with it some more to see if anything else is broken but it looks right so far.
–
UiyApr 28 '12 at 23:41