[Tex/LaTex] Tikz circle edge color not showing

colortikz-pgf

I am trying to plot some circles with a black edge and white face color.
The circles are placed on the edge of an ellipse.
I cannot figure out why this code is not working:

\documentclass{minimal}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
    \shadedraw [inner color=black!10,outer color=black!60,domain=0:2*pi] plot ({2*cos(\x r)},{1*sin(\x r)});
    \foreach \a in {0,0.6283,...,6.2832}
           {
               % I was expecting circles with a black edge
               \fill [black,fill=white] ({2*cos(\a r)},{1*sin(\a r)}) circle (4pt);
           }
\end{tikzpicture}
\end{document}

This is what I get (the circle edges are either white or are not drawn at all):

enter image description here

Thanks!

Best Answer

Use draw=black or \filldraw. As Grimler also says, with \fill the color is only applied as as a fill color. You're not telling TikZ to draw the shape, only fill it, and the fill color is set to white. By adding draw=black the shape is drawn as well, with the specified color. With \filldraw[black,fill=white] the outline of the shape is drawn in black, and filled with white. (Actually, the order is first filling, then drawing.)

enter image description here

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
    \shadedraw [inner color=black!10,outer color=black!60,domain=0:2*pi] plot ({2*cos(\x r)},{1*sin(\x r)});
    \foreach \a in {0,0.6283,...,6.2832}
           {
           % \filldraw [black,fill=white] ({2*cos(\a r)},{1*sin(\a r)}) circle (4pt);
               \fill [draw=black,fill=white] ({2*cos(\a r)},{1*sin(\a r)}) circle (4pt);
           }
\end{tikzpicture}
\end{document}