I have a list of N points (e.g. {(0,0),(42,7),...,(0,1)}). I want to use them as coordinates in TikZ, to draw some things. And I would like to fit them into a node (using TikZ's fit module (cf. http://www.texample.net/tikz/examples/feature/fit/ or PGF documentation §34) to put a label under them.
If I have, for example, 4 points, I can manually do it, and it works perfectly :
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{calc,fit}
\begin{document}
\begin{tikzpicture}
\newcounter{i}
\setcounter{i}{0}
\foreach \point in
{(0,0),(0,2),(2,0),(2,2)}
{
\node[coordinate] (point-\arabic{i}) at \point { };
\fill (point-\arabic{i}) circle (0.1);
\stepcounter{i}
}
\node (box) [draw=gray,dashed, inner sep=10pt,fit=(point-0) (point-1) (point-2) (point-3)] {};
\node (label) at (box.south) [below] { blah };
\end{tikzpicture}
\end{document}
which gives :

Now I want to do the same for an arbitrary number of points. I hoped a \foreach would work:
\node (boxforeach) [draw=gray,dashed, inner sep=10pt,fit= \foreach \j in {0,1,...,3}{(point-\j) } ] {};
but all I get are lots of ! Package tikz Error: Cannot parse this coordinate..
Is there a mean to get that working? If there isn't, do you have a simple method to calculate the coordinates of the box manually?


