节点编号问题?

节点编号问题?
\begin{tikzpicture}

\coordinate (1) at (0,0);
\coordinate (2) at (1,0);
\coordinate (3) at (0.5,1);
\coordinate (4) at (0,0);
\coordinate (5) at ($(1)!.5!(2)$);
\coordinate (6) at ($(2)!.5!(3)$);
\coordinate (7) at ($(3)!.5!(1)$);
\foreach \i in {1,...,3}
\fill (\i) circle (1pt) node [below] {\i};

\foreach \i in {5}
\fill (\i) circle (1pt) node [below] {\i};
\foreach \i in {6,7}
\fill (\i) circle (1pt) node [above] {\i};

\draw (1)--(2)--(3)--(4);

\end{tikzpicture}

在此处输入图片描述

答案1

在此处输入图片描述

\documentclass[tikz]{standalone}
\usepackage{}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}[label distance=-2pt]

\coordinate (1) at (1:210);
\coordinate (2) at (1:-30);
\coordinate (3) at (1:90);

\coordinate (4) at ($(1)!.5!(2)$);
\coordinate (5) at ($(2)!.5!(3)$);
\coordinate (6) at ($(3)!.5!(1)$);
\foreach \i in {1,...,3}
\fill (\i) circle (1pt) node[label=90+\i*120:\i] {};

%\foreach \i in {5}
%\fill (\i) circle (1pt) node [below] {\i};
\foreach \i in {4,...,6}
\fill (\i) circle (1pt) node[label=150+\i*120:\i] {};

\draw (1)--(2)--(3)--cycle;

\end{tikzpicture}
\end{document}

相关内容