9

I have a code for two intersecting circles:

\begin{tikzpicture}
    \draw (0,0) circle (1cm);
    \draw (2,-2)  circle (2cm);
\end{tikzpicture}

which outputs this:

enter image description here

And I want to zoom into the intersection area without writing a new block of code. I can do this by using arcs:

\begin{tikzpicture}
    \tikzstyle{intersection} = [draw, circle ,fill=darkgray, inner sep=0.3mm]
    \draw (0,0) arc (-90:70:1cm);
    \draw (2,1.5)  arc (100:200:2cm);
\end{tikzpicture}

which outputs this:

enter image description here

which resembles what I want. But it is very inconvenient if I do this over and over again. So, is there a simpler way to reuse a cropped part of a tikzpicture?

padawan
  • 1,532

1 Answers1

19
\documentclass[tikz, margin=3mm]{standalone}

\begin{document}
\begin{tikzpicture}
\clip (0,0) rectangle + (1.2,-1.2); % <added, size of rectangle is estimated 
                                    % from circles radius and distances between
                                    % centers of circles
    \draw (0,0) circle (1cm);
    \draw (2,-2)  circle (2cm);
\end{tikzpicture}
\end{document}

enter image description here

Zarko
  • 296,517