\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
两点。
\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}