\documentclass{article}
\usepackage{animate}
\usepackage{tikz}
\usepackage{tkz-graph}
\usetikzlibrary{arrows}
\usetikzlibrary{lindenmayersystems}
\usepackage[paperheight=20.2cm,paperwidth=16.2cm,bottom=-1cm,top=-1cm,left=-1.8cm,right=0cm]{geometry}
\begin{document}
\begin{tikzpicture}
\foreach \x in {31,91,...,391}{%
\draw (\x:3cm) circle (5pt)[fill=black];
\draw (\x:5cm) circle (5pt)[fill=black];
\draw (\x:3cm) [line width=1pt]-- (\x+60:3cm);
\draw (\x:3cm) [line width=1pt]-- (\x+120:3cm);
\draw (\x:3cm) [line width=1pt]-- (\x+180:3cm);
\draw (\x:5cm) [line width=1pt]-- (\x-60:3cm);
\draw (\x:5cm) [line width=1pt]-- (\x+60:3cm);
\draw (\x:5cm) [line width=1pt]-- (\x-120:3cm);
\draw (\x:5cm) [line width=1pt]-- (\x+120:3cm);
\draw (\x:5cm)[line width=1pt]..controls(\x+120:11cm)..(\x+180:3cm);
%\draw (\x:3cm) [line width=3pt] -- (\x+144:3cm);
%\draw (\x:3cm) [line width=3pt] -- (\x:3cm);}
\draw(31:3cm)node[right=2pt]{\huge $v_6$};
\draw(91:3cm)node[above=2pt]{\huge $v_1$};
\draw(151:3cm)node[left=2pt]{\huge $v_2$};
\draw(211:3cm)node[left=2pt]{\huge $v_3$};
\draw(271:3cm)node[below=2pt]{\huge $v_4$};
\draw(331:3cm)node[right=2pt]{\huge $v_5$};
\draw(271:5cm)node[below=3.5cm]{\huge $S'(K_6)$};
\draw(31:5cm)node[right=2pt]{\huge $v_6'$};
\draw(91:5cm)node[above=2pt]{\huge $v_1'$};
\draw(151:5cm)node[left=2pt]{\huge $v_2'$};
\draw(211:5cm)node[left=2pt]{\huge $v_3'$};
\draw(271:5cm)node[below=2pt]{\huge $v_4'$};
\draw(331:5cm)node[right=2pt]{\huge $v_5'$};
\end{tikzpicture}
\end{document}
私は、内側のラベルがエッジと重なり合った上記のグラフを描いています。誰かが重なり合って描かれたり、同じグラフを別の方法で描かれたりすれば、私にとっても役立つでしょう。
答え1
まず、コードにエラーがあります。ループ本体を終了する中括弧がコメントアウトされていますforeach
。
レイアウトの問題に関して: controls
2 つのポイントを使用します。
\draw (A) .. controls (a) and (b) .. (B);
路線は(A)
に向かって出発し、の方向から(a)
接近します。(B)
(b)
アプリケーションでは、
\draw (\x:5cm)[line width=1pt]..controls(\x+120:11cm)..(\x+180:3cm);
による
\draw (\x:5cm)[line width=1pt]..controls(\x+100:10cm) and (\x+120:11cm)..(\x+180:3cm);
\documentclass{article}
\usepackage{animate}
\usepackage{tikz}
\usepackage{tkz-graph}
\usetikzlibrary{arrows}
\usetikzlibrary{lindenmayersystems}
\usepackage[paperheight=20.2cm,paperwidth=16.2cm,bottom=-1cm,top=-1cm,left=-1.8cm,right=0cm]{geometry}
\begin{document}
\begin{tikzpicture}
\foreach \x in {31,91,...,391}{%
\draw (\x:3cm) circle (5pt)[fill=black];
\draw (\x:5cm) circle (5pt)[fill=black];
\draw (\x:3cm) [line width=1pt]-- (\x+60:3cm);
\draw (\x:3cm) [line width=1pt]-- (\x+120:3cm);
\draw (\x:3cm) [line width=1pt]-- (\x+180:3cm);
\draw (\x:5cm) [line width=1pt]-- (\x-60:3cm);
\draw (\x:5cm) [line width=1pt]-- (\x+60:3cm);
\draw (\x:5cm) [line width=1pt]-- (\x-120:3cm);
\draw (\x:5cm) [line width=1pt]-- (\x+120:3cm);
%\draw (\x:5cm)[line width=1pt]..controls(\x+120:11cm)..(\x+180:3cm);
\draw (\x:5cm)[line width=1pt]..controls(\x+100:10cm) and (\x+120:11cm)..(\x+180:3cm);
%\draw (\x:3cm) [line width=3pt] -- (\x+144:3cm);
%\draw (\x:3cm) [line width=3pt] -- (\x:3cm);
}
\draw(31:3cm)node[right=2pt]{\huge $v_6$};
\draw(91:3cm)node[above=2pt]{\huge $v_1$};
\draw(151:3cm)node[left=2pt]{\huge $v_2$};
\draw(211:3cm)node[left=2pt]{\huge $v_3$};
\draw(271:3cm)node[below=2pt]{\huge $v_4$};
\draw(331:3cm)node[right=2pt]{\huge $v_5$};
\draw(271:5cm)node[below=3.5cm]{\huge $S'(K_6)$};
\draw(31:5cm)node[right=2pt]{\huge $v_6'$};
\draw(91:5cm)node[above=2pt]{\huge $v_1'$};
\draw(151:5cm)node[left=2pt]{\huge $v_2'$};
\draw(211:5cm)node[left=2pt]{\huge $v_3'$};
\draw(271:5cm)node[below=2pt]{\huge $v_4'$};
\draw(331:5cm)node[right=2pt]{\huge $v_5'$};
\end{tikzpicture}
\end{document}