答案1
您可以使用该decorations.text
库:
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\draw[-latex,blue,postaction={decorate},decoration={text along path,
text={Positive direction},text align=center}]
(4,0) arc [start angle=-60,end angle=80,radius=4];
\end{tikzpicture}
\end{document}
如果您希望文本位于路径的中间(尽管这会降低可读性):
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\path[decorate,decoration={text along path,
text={Positive direction},text align=center}]
(4,0) arc [start angle=-60,end angle=80,radius=4];
\draw[-latex,blue]
(4cm,0.8ex) arc [start angle=-60,end angle=80,radius=4cm-0.8ex];
\end{tikzpicture}
\end{document}
答案2
如果文本要位于路径上方,则text effects along path
装饰允许为每个字符填充背景:
\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{decorations.text}
\begin{document}
\tikz\path[draw=blue, -stealth,
postaction={decorate,decoration={text effects along path,
text={\ Positive direction\ }, text align=center,
text effects/.cd,
text along path,
every character/.style={fill=white, yshift=-0.5ex}}}]
(4, 0) arc [start angle=-60, end angle=80, radius=4];
\end{document}