2

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?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.