我尝试去追随这个问题寻找如何绘制一个箭头,从一个节点返回到自身,形成一个漂亮的循环,但我不明白为什么我的代码没有提供循环。在下面的代码中,我希望带有标签 A 的节点有一个返回自身的循环。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{arrows,shapes,decorations,automata,backgrounds,petri}
\begin{document}
\begin{tikzpicture}
\begin{scope}[every node/.style={circle,thick,draw}]
\node (A) at (0,3) {A};
\node (B) at (3,3) {B};
\node (C) at (6,3) {C};
\node (D) at (6,0) {D};
\node (E) at (6,-3) {E};
\node (F) at (3,-3) {F};
\node (G) at (0,-3) {G};
\node (H) at (0,0) {H};
\end{scope}
\begin{scope}[>={Stealth[black]},
every node/.style={fill=white,circle},
every edge/.style={draw=black}]
\path [red,->] (A.90) arc (0:264:4mm) node {$xx$} (A);
\path [->] (A) edge node {$xx$} (B);
\path [->] (A) edge[bend left=60] node {$xx$} (C);
\path [->] (A) edge node {$xx$} (D);
\path [->] (A) edge node {$xx$} (E);
\path [->] (A) edge node {$xx$} (F);
\path [->] (A) edge[bend right=60] node {$xx$} (G);
\path [->] (A) edge node {$xx$} (H);
\end{scope}
\end{tikzpicture}
\end{document}
正如您所见,箭头并没有从节点“弯曲”出来。