[Tex/LaTex] Filling exterior of a circle

diagramstikz-pgf

I want to create a picture like the one attached below using tikzpicture. I could only draw two concentric circles. How do I colour them as in the picture?

Can anyone help me? I am pretty new to usage of TikZ.

wanted

Best Answer

A PSTricks solution:

\documentclass{article}

\usepackage{pstricks}

\begin{document}

\begin{pspicture}(4,3)
 \psset{fillstyle = solid}
  \psframe[fillcolor = orange](0,0)(4,3)
  \pscircle(2,1.5){1}
  \pscircle[fillcolor = cyan](2,1.5){0.8}
\end{pspicture}

\end{document}

output1

In case you want the fill color of the ring to be the same as the background color, you can do the following:

\documentclass{article}

\usepackage{pstricks}
\usepackage{pagecolor}
\def\bgcolor{green!50} % background color
\pagecolor{\bgcolor}

\begin{document}

\begin{pspicture}(4,3)
 \psset{fillstyle = solid}
  \psframe[fillcolor = orange](0,0)(4,3)
  \pscircle[fillcolor = \bgcolor](2,1.5){1}
  \pscircle[fillcolor = cyan](2,1.5){0.8}
\end{pspicture}

\end{document}

output2