0

I'm currently able to draw this image with the following code: Circles

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}
    \tkzInit[xmax=3,ymax=3,xmin=-3,ymin=-3]
    \tkzGrid
    \tkzAxeXY
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(1,0){B}
    \tkzDefPoint(2,0){C}
    \tkzDefCircle[through](A,B)
    \tkzDefCircle[through](A,C)
    \tkzDrawCircle[color=red](A,C)
    \tkzDrawCircle[color=red](A,B)
\end{tikzpicture}
\end{document}

And I want to fill parts of the outer circle, but it shouldn't overwrite the inner circle. Basically like this: Filled Circle

How could I do this with tkz-euclide or any other tikz library?

2
  • Please make your code compilable. Nov 16, 2020 at 17:13
  • 1
    is this what you want? \documentclass[tikz,border=5mm]{standalone} \begin{document} \begin{tikzpicture} \draw[gray!20] (-3,-3) grid[step=5mm] (3,3); \fill[cyan] (2,0) arc(0:90:2) --(0,1) arc(90:0:1)--cycle (-2,0) arc(180:270:2) --(0,-1) arc(270:180:1)--cycle; \draw[violet,thick] (0,0) circle(1) circle(2); \draw[blue] (-3,0)--(3,0) (0,-3)--(0,3); \end{tikzpicture} \end{document}
    – Black Mild
    Nov 16, 2020 at 18:20

1 Answer 1

2

I am not too familiar with tkz-euclide but with just TikZ it is very easy.

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}
\begin{scope}
 \clip (0,-3) -| (-3,0) -| (3,3) -| cycle;
 \fill[gray,even odd rule] circle[radius=2] circle[radius=1];
\end{scope}
\draw[red]  circle[radius=2] circle[radius=1];
\end{tikzpicture}
\end{document}

enter image description here

1
  • this is perfect, thanks!
    – drblau
    Nov 16, 2020 at 17:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .