我没看明白连接线的规律,所以没画
\documentclass{article}
\usepackage{tikz}
\begin{document}
\newcounter{mycount}
\setcounter{mycount}{1}
\begin{tikzpicture}
\foreach \s in {2,...,8}
{
\pgfmathsetmacro{\z}{\s-1}
\foreach \x in {1,...,\z}
{
\draw node[draw,circle,inner sep=2pt] at (\x, \s-\x) {\themycount\global\stepcounter{mycount}};
}
}
\draw[-latex] (-1,0) -- (9,0) node[below] {$x$};
\draw[-latex] (0,-1) -- (0,9) node[left] {$y$};
\foreach \i in {1,...,7}
{
\fill (\i,0) circle[radius=1pt] node[below] {\i};
\fill (0,\i) circle[radius=1pt] node[left] {\i};
}
\filldraw (0,0) circle[radius=2pt] node[below left] {$O$};
\end{tikzpicture}
\end{document}
问 一个需要循环的绘图请教