只需添加left
。通常情况下你会想要above
,但由于旋转,你需要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}