Remember that the elements of the drawing are drawn in the order they appear in the code, so when the line of coding that fills the circles are drawn last, they will cover the parts that have been drawn before. By simply moving them to the top of the code, you get that you want:
Code: Select all
\begin{tikzpicture}[scale=2]
\draw[fill,color=red](0,0) circle (2cm);
\draw[fill,color=white](0,0) circle (1cm);
\coordinate [label=left:$O$] (O) at (0,0);
\coordinate [label=above right:$A$] (A) at (1,0);
\coordinate [label=right:$B$] (B) at (2,0);
\node[draw,circle through=(A)] at (O){};
\node[draw,circle through=(B)] at (O){};
\filldraw[black](A) circle (1pt);
\filldraw[black](B) circle (1pt);
\filldraw[black](O) circle (1pt);
\draw (O)--(A)--(B);
\end{tikzpicture}
Note that you do not have to specify the radius two times when drawing circles. You only have to do that if you want an ellipse.
Another way is to use the
pgfonlayer-environment (see section 65 in
pgfmanual):
Code: Select all
\begin{tikzpicture}[scale=2]
\coordinate [label=left:$O$] (O) at (0,0);
\coordinate [label=above right:$A$] (A) at (1,0);
\coordinate [label=right:$B$] (B) at (2,0);
\node[draw,circle through=(A)] at (O){};
\node[draw,circle through=(B)] at (O){};
\filldraw[black](A) circle (1pt);
\filldraw[black](B) circle (1pt);
\filldraw[black](O) circle (1pt);
\draw (O)--(A)--(B);
\begin{pgfonlayer}{background}
\draw[fill,color=red](0,0) circle (2cm);
\draw[fill,color=white](0,0) circle (1cm);
\end{pgfonlayer}
\end{tikzpicture}