我有这个代码:
\documentclass[border=0.5cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[color=cyan] (0,0) circle(3cm);
\foreach \i in {0,1,2,3,4}
\filldraw (72*\i:3) circle(1pt) node (a\i) {};
\draw[blue,line width=1pt] (a0)--(a1)--(a2)--(a3)--(a4)--(a0)--cycle;
\foreach \i in {0,1,2,3,4} \draw[black] (72*\i:3.3) node (b\i) {$A_{\i}$};
\end{tikzpicture}
\end{document}
输出如下:
为什么角落没有被封闭?
答案1
间隙是由inner sep
a引起的node
(如果你从节点 Ti 开始绘制钾Z 只会在节点外部启动线路)。
我建议你改变做事的顺序:首先只放置坐标,然后画线,然后画圆(否则线会位于圆上方)。以下是这样做的:
\documentclass[border=0.5cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[color=cyan] (0,0) circle(3cm);
\foreach \i in {0,1,2,3,4} \path (72*\i:3) coordinate (a\i);
\draw[blue,line width=1pt] (a0)--(a1)--(a2)--(a3)--(a4)--(a0)--cycle;
\foreach \i in {0,1,2,3,4}
\filldraw (a\i) circle[radius=1pt] (72*\i:3.3) node (b\i) {$A_{\i}$};
\end{tikzpicture}
\end{document}