I am making arrows using
\begin{tikzpicture}
\tikzset{
operatorNode/.style={
every node/.style={minimum size=1cm,draw,rectangle}
},
variableNode/.style={
every node/.style={minimum size=1cm,draw,circle}
}
}
\begin{scope}[operatorNode]
\node (x) at (0,0) {$4$};
\end{scope}
\begin{scope}[variableNode]
\node (z1) at (4,0) {$z$};
\node (z2) at (8,-2) {$z$};
\end{scope}
\draw[->] (x) -- (z1) node [near start, above] {$1$};
\draw[->] (x) -- (z2) node [near start, above] {$2$};
\end{tikzpicture}
However I have multiple arrows of variable length, hence the 'near start' option results in different label positions for different arrows. This happens because the 'near start' places the label at a relative position.
Is it also possible to place the label at an absolute distance from the start (or the end) from the arrow head?
\draw[->] (v2) node [above right] {$1$} -- (z) ;
? how far the node should be fromv2
? – Zarko May 13 '19 at 10:45