In tikz
you can position a node along a path using at start
, midway
or pos=
syntax. This works fine, when using paths with --
syntax. I have noticed that tikz fails to position nodes correctly, when they use the to[]
syntax instead.
Here is a trivial example of this behaviour:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[thick] (0,2) -- (5,2) node [midway, anchor=south] {Text} node [at start,anchor=north]{abcd} node [anchor=north,pos=0.8]{xyz};
\draw[thick] (0,0) to[out=0,in=180] (5,0) node [midway, anchor=south] {Text} node [at start,anchor=north]{abcd} node [anchor=north,pos=0.8]{xyz};
\end{tikzpicture}
\end{document}
The fact that the second line is a straight line is merely to stress that this is not related to the bending you can achieve with the to
syntax. I would not normally use it for a straight line of course.
Is this intended and if yes, what would the best way to achieve the same output with the to
syntax?