我正在尝试绘制一个关于 216 个顶点的图形 - 215 个顶点分布在围绕支点的轮子上。然后我想将所有外围顶点连接到支点,并将轮子上的顶点以 5 个为一组连接起来。我设法做到了这一点,但无法区分 5 个组。我想将连接 5 个组中顶点的边缘弯曲,以便它们更容易辨别。
\begin{tikzpicture}[main/.style = {draw, circle, inner sep=1.2, fill=black}]
\node[main, label=right:{$e$}] at (360:0mm) (0) {};
\graph[circular placement, group polar shift=(360/215:0), empty nodes, radius=6cm, nodes={circle, inner sep=1.2, draw=black, fill=black}] {
\foreach \x in {1,...,215} {
\x -- (0);
};
\foreach \x [evaluate={\xi=int(\x+4);}] in {1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101, 106, 111, 116, 121, 126, 131, 136, 141, 146, 151, 156, 161, 166, 171, 176, 181, 186, 191, 196, 201, 206, 211} {
\foreach \y in {\x,...,\xi} {
\x -- \y;
};
};
};
\end{tikzpicture}
其中不同的颜色只是为了突出显示示例中的 5 个不同组。我尝试过,\x to [out=275,in=265,looseness=2] \y;
但没有用。还有类似的东西也\draw \x to [out=275,in=265,looseness=2] \y;
没有用。任何帮助都非常感谢!
答案1
据我了解,你想要什么,下面是一种开始的方法。不过,我不知道你想如何分配颜色:
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{graphs}
\begin{document}
\begin{tikzpicture}[main/.style = {draw, circle, inner sep=1.2, fill=black}]
\node[main, label=right:{$e$}] at (360:0mm) (0) {};
\graph[circular placement, group polar shift=(360/215:0), empty nodes, radius=6cm, nodes={circle, inner sep=1.2, draw=black, fill=black}] {
\foreach \x in {1,...,215} {
\x -- (0);
};
};
\foreach \x [evaluate={\xi=int(\x+4);}] in {1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101, 106, 111, 116, 121, 126, 131, 136, 141, 146, 151, 156, 161, 166, 171, 176, 181, 186, 191, 196, 201, 206, 211}
{
\foreach \y in {\x,...,\xi} \draw[blue] (\x) to[bend left=80] (\y);
}
\end{tikzpicture}
\end{document}
编辑:也许您想将 5 个顶点组中的每个顶点链接到其他 4 个顶点。在这种情况下,您的foreach
循环可能没有完整编写。
答案2
感谢您发布的解决方案!基于它们,以下是最终的代码:
\begin{tikzpicture}[main/.style = {draw, circle, inner sep=1.2, fill=black}]
\node[main, label=right:{$e$}] at (360:0mm) (0) {};
\graph[circular placement, group polar shift=(360/215:0), empty nodes, radius=6cm, nodes={circle, inner sep=1.2, draw=black, fill=black}] {
\foreach \x in {1,...,215} {
\x -- (0);
};
};
\foreach \x [evaluate={\xi=int(\x+4);}] in {1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101, 106, 111, 116, 121, 126, 131, 136, 141, 146, 151, 156, 161, 166, 171, 176, 181, 186, 191, 196, 201, 206, 211} {
\foreach \y in {\x,...,\xi} {
\foreach \v in {\y,...,\xi} \draw[black] (\v) to[bend left=90, looseness=2] (\y);
}
}
\end{tikzpicture}