I'd like to use TiKZ to generate stand-alone PDF diagrams programatically. I have an application that generates simple geometry of lines and arcs etc and I'd like to create (using e.g. Ruby) TikZ diagram text files from that simple geometry.
I have a bounding box (AABB) of each chunk of geometry and my question is what is the most idiomatic TiKZ and LaTeX/ConTeXt way of specifying what would in effect be a window-to-viewport transform between the application geometry bounds and the TiKZ drawing bounds?
I can see I can use:
\begin{tikzpicture}[x=2cm,y=1.5cm]
to set distance units and:
scale=1.5
parameter, but I suspect there's a better way.
Any advice is much appreciated,
Best Answer
I'm not sure this is what your looking for, but probably you want something like this:
You can specify all axes as
x={(x-component,y-component)}
. In this example you can specify the angle in which a coordinate axis points (xangle
) and it's length (xlength
). From this, the components are automatically computed. In the options for the TikZ picture I wrote\xx cm
, otherwise TikZ will assume the measures are given in points, thus resulting in a very tiny picture. Try playing around with the xyzangle
s and xyzlength
s to see the picture change.