Why the second picture doesn't give the same result as the first one? Is
this behaviour of scope of nodes intentional? If I give absolute
coordinates to nodes, then both pictures gives the same (expected)
result -- move the node "b" from "a" for 21mm down.
Regards,
Zarko
Any response to above described behaviour of "scope" in TikZ I will very
appreciated. Using the first example instead grouping by "scope" is in
the case of large set of nodes really annoying.
Regards, Zarko
Nodes are `a bit special' in that their anchors are returned absolutely
independently of the current coordinate transformation.
This can be seen to be desirable as the construction of a connecting path could
be transformed (i.e., shifted, scaled, or rotated) in some way, but would still
need to access the correct untransformed anchors of the node in order to connect
correctly.
It is possible to transform node coordinates by adding transform options to
coordinates them selves, for example:
\draw ([xshift=1cm]A) -- ([yshift=1cm]B);
Regards
Stefan Pinnow
"Zarko F. Cucej" <zarko...@gmail.com> schrieb im Newsbeitrag
news:hbL5n.453$UU2....@news.siol.net...
Dear Stefan Pinnow,
thank you for your information. I do not read pgf-user mailing list, so
probably this be good idea for learn more about pgf/tikz. Anyway, I
afraid that this behaviour is feature ... in my case this is pity, since
I should now find another solution for code of my sketch.
Regards,
zarko
If you will start reading the pgf-mailing list you can directly post it there,
otherwise write it here and I will forward it.
Best regards,
Stefan
Hi
Normal. From pgfmanual
"The most important aspect of the coordinate transformation matrix
is that it applies to coordinates only! In particular, the coordinate
transformation has no effect on things like the line width or the dash
pattern or the shading angle. 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.) The general rule is “If there is no
‘coordinate’ involved, even ‘indirectly,’ the matrix is not applied.”
However, sometimes, you simply have to try or look it up in the
documentation whether the matrix will be applied.
Setting the matrix cannot be done directly. Rather, all you can do is
to “add” another transformation to the current matrix. However, all
transformations are local to the current TEX-group."
yshift is a transformation
but now you can see the result of
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=2]
\node[name=a] {a};
\node[name=b] at ([yshift=-21mm]a) {b};
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}[scale=2]
\node[name=a] {a};
\node[name=b,yshift=-21mm] at (a) {b};
\end{tikzpicture}
\end{document}
And you have the same problem with the "positioning" library
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[scale=2]
\node[name=a] {a};
\node[name=b,above=-21mm of a] {b};
\end{tikzpicture}
\end{document}
By default, I suppose you don't want labels are rotated or scaled, and
I suppose
it's the same for line width
Now you can use "transform shape" but the results are ugly is some cases
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[scale=2]
\node[name=a] {a};
\node[name=b] at ([yshift=-21mm]a) {b};
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}[scale=2]
\node[name=a] {a};
\begin{scope}[transform shape]
\node[name=b,yshift=-21mm] at (a) {b};
\end{scope}
\end{tikzpicture}
\begin{tikzpicture}[scale=2]
\node[name=a] {a};
\begin{scope}[transform shape]
\node[name=b,above=-21mm of a] {b};
\end{scope}
\end{tikzpicture}
\end{document}
now a solution but ...
\begin{tikzpicture}[]
\node[name=a] {a};
\begin{scope}[yshift=-21mm]
\pgfextractx{\xdim}{(a)}
\pgfextractx{\ydim}{(a)}
\node[name=b] at (\xdim,\ydim) {b};
\end{scope}
\end{tikzpicture}
and more ugly but fun
\begin{tikzpicture}[]
\node[name=a] {a};
\begin{scope}[yshift=-21mm]
\pgfextractx{\xdim}{(a)}
\pgfextractx{\ydim}{(a)}
\coordinate(a) at (\xdim,\ydim) {};
\node[name=b] at (a) {b};
\end{scope}
\end{tikzpicture}
Best regards
Alain Matthes
Meanwhile I manage my problem as you suggest. Fortunately, there
copy-past has been of big help.
Regrads,
Zarko
Dear Alain,
thank you very much for detailed elaboration of the problem. I will
carefully go through your examples after my returning home.
Best regards,
Zarko
[...]