# Label following arrow in TikZ

I want to write diagonal arrows, with the label lay down to the arrow.

Something like this:

Here is my best attempt, but it does not work

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node (A) at (0,0) {$\bullet$};
\node (B) at (-2,-1) {$\bullet$};
\draw[thick,->] (A) -- (B) node[midway,sloped,rotate=270] {$\frac 34$};
\end{tikzpicture}
\end{document}


I just get this:

• If you need it just once (or twice) you could use a xshift and yshift per node, but it doesn't make much sense for many nodes. Feb 16, 2017 at 14:15

Just add left. Normally you'd want above, but because of the rotation you need left.

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\node (A) at (0,0) {$\bullet$};
\node (B) at (-2,-1) {$\bullet$};
\draw[thick,->] (A) -- (B) node[midway,sloped,left,rotate=270] {$\frac{3}{4}$};
\end{tikzpicture}
\end{document}