我正在努力弄清楚如何製作一個將 12 個圓形節點連接成一個圓圈的圖。我有代碼:
\begin{tikzpicture}
\graph [nodes={draw, circle}, clockwise, radius=3in, nodes, n=12] {
subgraph C_n [name=outer]
};
\end{tikzpicture}
這給了我這個: 但我希望連接它們的邊緣是彎曲的,以便它類似於圓形而不是十二面體。由於這個問題類似於連接節點的逆時針路徑曲線我嘗試複製該程式碼,但使用 12 個節點而不是 4 個,這給了我一個正方形。此方法的唯一優點是我能夠在 0 而不是 1 處啟動節點,正如我希望在最終產品中所做的那樣。
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=3cm, thick,main node/.style={circle,draw,font=\sffamily\Large\bfseries}]
\node[main node] (1) {0};
\node[main node] (2) [below right of=1] {1};
\node[main node] (3) [below right of=2] {2};
\node[main node] (4) [below right of=3] {3};
\node[main node] (5) [below left of=4] {4};
\node[main node] (6) [below left of=5] {5};
\node[main node] (7) [below left of=6] {6};
\node[main node] (8) [above left of=7] {7};
\node[main node] (9) [above left of=8] {8};
\node[main node] (10) [above left of=9] {9};
\node[main node] (11) [above right of=10] {t};
\node[main node] (12) [above right of=11] {e};
\path[every node/.style={font=\sffamily\small}]
(1) edge [bend right] node[right] {} (2)
(2) edge [bend right] node[right] {} (3)
(3) edge [bend right] node[right] {} (4)
(4) edge [bend right] node[right] {} (5);
(5) edge [bend right] node[right] {} (6)
(6) edge [bend right] node[right] {} (7)
(7) edge [bend right] node[right] {} (8)
(8) edge [bend right] node[right] {} (9);
(9) edge [bend right] node[right] {} (10)
(10) edge [bend right] node[right] {} (11)
(11) edge [bend right] node[right] {} (12)
(12) edge [bend right] node[right] {} (1);
\end{tikzpicture}
有沒有辦法讓節點和邊都變成圓形?
答案1
關於什麼:
\documentclass[tikz]{standalone}
\usetikzlibrary{graphs, graphs.standard}
\begin{document}
\begin{tikzpicture}
\graph [nodes={draw, circle}, clockwise, radius=3in, nodes, n=12, edge={bend left=12}] {
subgraph C_n [name=outer]
};
\end{tikzpicture}
\end{document}
編輯:再次閱讀你的問題後,我發現你想從 0 開始。
\documentclass[tikz]{standalone}
\usetikzlibrary{graphs, graphs.standard}
\begin{document}
\begin{tikzpicture}
\graph [nodes={draw, circle, minimum width=.25in, inner sep=0pt}, clockwise, radius=1in, nodes, n=12, V={0,...,11}, ->, edge={bend left=10,>=stealth}] {
subgraph C_n [name=outer]
};
\end{tikzpicture}
\end{document}