答案1
一些图库可能适合这项任务......但我没有使用任何图库(我喜欢手工做事!)有很多arc
带有圆形数值的图库,但对于第一个例子,我希望它足够了!:)
以下是代码
\documentclass[margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[
rotate=22.5,
myline/.style={line width=2}
]
%% Setting coordinates
\foreach \n in {1,...,8}{
\coordinate (P\n) at (\n*45:1);
}
\coordinate (P9) at ($.5*(P3)+.5*(P8)$);
\coordinate (P10) at ($.5*(P4)+.5*(P7)$);
%% Drawing the graph
\draw[myline,blue!70] (P5) -- (P6) -- (P10) -- (P8) -- (P7);
\draw[myline,red!70] (P5) -- (P4) edge (P3) -- (P10);
\draw[myline,green!70] (P2) -- (P9) -- (P1) -- (P8);
%% Drawing the shapes
\draw[dashed] (0,0) circle (1.4);
\draw[green!70!black] (0:1.25) arc (0:90:1.25) arc (90:190:.25)
-- ($(P9)+(-170:.25)$) arc (-170:-120:.25)
-- ($(P8)+(-120:.25)$) arc (-120:0:.25);
\draw[red!70] (135:1.25) arc (135:225:1.25) arc (225:300:.25)
-- ($(P10)+(300:.25)$) arc (300:390:.25)
-- ($(P3)+(30:.25)$) arc (30:135:.25);
\draw[blue!70] (225:1.2) arc (225:360:1.2) arc (0:100:.2)
-- ($(P10)+(110:.2)$) arc (110:120:.2)
-- ($(P5)+(120:.2)$) arc (120:225:.2);
%% Drawing the node
\foreach \n in {1,...,10}{
\fill (P\n) circle (.1);% node[scale=.3,white]{\n};
}
\end{tikzpicture}
\end{document}
这使