我想画一个有 8 个节点且每条边有不同的箭头的圆,如下所示:
到目前为止我已经用节点制作了圆圈。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw (0, 0) circle (2);
\foreach \x in {1,...,8} {
\node[shape=circle,fill=black, scale=0.5] at ({((\x-1)*360/8)+90}:2) {};
};
\end{tikzpicture}
\end{document}
答案1
-135
您手绘的从到 的弧中间的箭头不清楚-180
。
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[scale=.8]
\tikzset{myarrow/.style args={at position #1 with #2}{
postaction={decorate},
decoration={markings, % switch on markings
mark=at position #1 with {#2}
}}}
\draw (0,0) circle(2);
\foreach \i in {0,...,7}
\fill[magenta] (45*\i:2) circle(2pt);
\path[
myarrow=at position .5 with {\arrow{latex}}]
(0:2) arc(0:-45:2);
\path[
myarrow=at position .45 with {\arrow{latex}},
myarrow=at position .55 with {\arrow{latex}}]
(-45:2) arc(-45:-90:2);
\path[
myarrow=at position .58 with {\arrow{latex}},
myarrow=at position .5 with {\arrow{latex}},
myarrow=at position .42 with {\arrow{latex}}]
(-90:2) arc(-90:-135:2);
\path[
myarrow=at position .35 with {\arrow{latex}},
myarrow=at position .45 with {\arrow{latex}},
myarrow=at position .55 with {\arrow{latex}},
myarrow=at position .65 with {\arrow{latex}}] (-135:2) arc(-135:-180:2);
\path[
myarrow=at position .5 with {\arrow{>}}]
(180:2) arc(180:135:2);
\path[
myarrow=at position .47 with {\arrow{>}},
myarrow=at position .53 with {\arrow{>}}] (135:2) arc(135:90:2);
\path[
myarrow=at position .45 with {\arrow{>}},
myarrow=at position .5 with {\arrow{>}},
myarrow=at position .55 with {\arrow{>}}] (90:2) arc(90:45:2);
\path[
myarrow=at position .425 with {\arrow{>}},
myarrow=at position .475 with {\arrow{>}},
myarrow=at position .525 with {\arrow{>}},
myarrow=at position .575 with {\arrow{>}}] (45:2) arc(45:0:2);
\end{tikzpicture}
\end{document}