在 TikZ 手册第 1002/1318 页中,有一个创建循环数组的示例,如下所示:
问题在于作者把每个圆的半径称为直径。以下是代码:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
Let's draw circles at interesting points:
\foreach \x / \y / \diameter in {0 / 0 / 2mm, 1 / 1 / 3mm, 2 / 0 / 1mm}
\draw (\x,\y) circle (\diameter);
% Same effect
\foreach \center/\diameter in {{(0,0)/2mm}, {(1,1)/3mm}, {(2,0)/1mm}}
\draw[yshift=2.5cm] \center circle (\diameter);;
\draw[red] [|-|] (0,0) -- ++(0,2mm);% I added this to measure the radius
\end{tikzpicture}
\end{document}
我对吗?