I am trying to draw a path and position nodes on it and fill them using this code and it works
\documentclass[varwidth=20cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [dotted](0,0)--(2.5,0.5)
node(2)[pos=0.1]{} node(3)[pos=0.2]{} node(4)[pos=0.3]{} node(5)[pos=0.4]{} node(6)[pos=0.5]{} node(7)[pos=0.6]{} node(8)[pos=0.7]{} node(9)[pos=0.8]{} node(1)[pos=0.9]{} node(10)[pos=1]{};
% \draw [red,dotted] plot [smooth] coordinates {(0,0) (1,0.1) (2,0.3) (2.5,0.5)};
\fill (1) circle[radius=1pt];
\fill (2) circle[radius=1pt];
\fill (3) circle[radius=1pt];
\fill (4) circle[radius=1pt];
\fill (5) circle[radius=1pt];
\fill (6) circle[radius=1pt];
\fill (7) circle[radius=1pt];
\fill (8) circle[radius=1pt];
\fill (9) circle[radius=1pt];
\fill (10)circle[radius=1pt];
\end{tikzpicture}
\end{document}
Now, i want to make it more efficient and not to repeat the same line of code 10 times by using \foreach. I stared by this piece of code put it gives this error Illegal unit of measure (pt inserted)
\documentclass[varwidth=20cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [dotted](0,0)--(2.5,0.5)
\foreach \x [evaluate=\x] in {1,2,...,10}
node(\x) [pos={\x/10}]{}
\fill (\x) circle[radius=1pt];
\end{tikzpicture}
\end{document}
\listfilesin your preamble and read out the log. I do not get the error you are getting. – LaRiFaRi Jul 15 '14 at 08:39\listfiles, i put it and nothing changed in the log. – Fadwa Jul 15 '14 at 08:44pgf.sty 2008/01/15 v2.10-cvs (rcs-revision 1.12)
– Fadwa Jul 15 '14 at 08:59