### Grids and the x-vector.

Andre Caldas <andre.em.caldas <at> gmail.com>

2016-01-20 13:44:52 GMT

Dear friends,
My name is André Caldas. I am really new to TikZ and PGF. I am really
amazed by it... it is fantastic!
I am writing some lecture notes in linear algebra. I intend to use
"grids", but sometimes, I want the axes to be different from those
given by x-vector=(1,0) and y-vector=(0,1). I wanted the grid to
produce an effect like this:
== BEGIN EXAMPLE ==
\begin{tikzpicture}
\coordinate (dot a) at (0,0);
\coordinate (dot b) at (2,2);
\coordinate (dot c) at (5,1);
\coordinate (dot d) at (3,-1);
\filldraw
(dot a) circle (0.1cm);
\filldraw
(dot b) circle (0.1cm);
\filldraw
(dot c) circle (0.1cm);
\filldraw
(dot d) circle (0.1cm);
\draw[->]
(dot a) -- node[above]{$v$} (dot b);
\draw[->]
(dot a) -- node[below]{$w$} (dot d);
\draw[->]
(dot a) -- node[above]{$v + w$} (dot c);
\begin{pgfonlayer}{background}
\draw[help lines, x={(dot d)}, y={(dot b)}]
(-0.0,-0.1) -- (0.0,1.1)
(-0.1, 0.0) -- (1.1,0.0)
( 1.0,-0.1) -- (1.0,1.1)
(-0.1, 1.0) -- (1.1,1.0);
% That is what I wanted to use, instead.
% \draw[help lines, x={(dot d)}, y={(dot b)}]
% (-0.1,-0.1) grid (1.1, 1.1);
\end{pgfonlayer}
\end{tikzpicture}
== END EXAMPLE ==
The pgfmanual says:
"/tikz/step=[...]
[...]
A complication arises when the x- and/or y-vector do not point along
the axes. Because
of this, the actual rule for computing the x-step and the y-step is
the following: As the
x- and y-steps we use the x- and y-components or the following two
vectors: The first vec-
tor is either (hx-grid-step-number i, 0) or (hx-grid-step-dimensioni,
0pt), the second vector is
(0, hy-grid-step-number i) or (0pt, hx-grid-step-dimensioni)."
However, at the same time, a couple of lines before...
"All coordinate transformations apply to the grid.
\tikz[rotate=30] \draw[step=1mm] (0,0) grid (2,2);"
My question is:
Why would I want to apply coordinate transformations to the grid, but
at the same time, I would not want to apply x-vector and y-vector???
It is interesting to notice that /tikz/x and /tikz/y are used for
grids only when they are NOT vectors. Wouldn't it make more sense to
simply use x-vector and y-vector instead of splitting things in two
cases?
As a final comment, I would like to notice this fragment of pgfmanual:
"[...] In certain cases, it is not immediately clear whether the
coordinate transformation matrix should apply to a certain dimension.
For example, should the coordinate transformation matrix apply to
grids? (It does.) And what about the size of arced corners? (It does
not.)"
Thank you very much,
André Caldas.
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
pgf-users mailing list
pgf-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users