I am struggling with the positioning of a node above a tikz path. The path is curved and connects two nodes with "to". Here is a MVE:

\begin{tikzpicture}[scale=1,transform shape]
\draw[->,thick,out=0,in=180] (1,0) to (5,1) node[above,pos=0.5,sloped] {text};
\draw[->,thick] (1,3) -- (5,4) node[above,pos=0.5,sloped] {text};

The node is above the line in the case with "--" but not with the "to". What I am missing here? I am pretty sure I had something similar working in the past...


Browse other questions tagged or ask your own question.