# Tikz circle edge color not showing

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):

Thanks!

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.)

\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}

• Great, that works. I wasn't aware that the draw key was needed. – Tobs Oct 29 '15 at 15:50

Or use \filldraw. May be you want to clip too and more samples so as to have a smoother ellipse..

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

\begin{tikzpicture}[,line width=1.4\pgflinewidth]
\clip [domain=0:2*pi,samples=500] plot ({2*cos(\x r)},{1*sin(\x r)});
\shadedraw [inner color=black!10,outer color=black!60,domain=0:2*pi,samples=500] 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
\filldraw [black,fill=white,line width=0.7\pgflinewidth] ({2*cos(\a r)},{1*sin(\a r)}) circle (4pt);
}
\end{tikzpicture}
\end{document}


• Thank you Harish, I'll increase the samples as you recommended. – Tobs Oct 29 '15 at 15:52