0

How can I fill the intersection between 2 circles or more with a different color? I want something similar to the attached photo.intersections

3

It can be done with clipping:

\documentclass{article}
\usepackage{tikz}

\definecolor{CircleBlue}{RGB}{0, 163, 232}
\definecolor{CircleYellow}{RGB}{254, 242, 0}
\definecolor{CircleOrange}{RGB}{255, 127, 38}

\begin{document}
\begin{tikzpicture}
  \def\Radius{10mm}
  \def\Distance{13mm}
  \path
    (0, 0) coordinate (C)
    +(120:\Distance) coordinate (A)
    +(60:\Distance) coordinate (B)
  ;
  \begin{scope}[radius=\Radius]
    \def\Circles{
      (A) circle[]
      (B) circle[]
      (C) circle[]
    }
    \fill[CircleBlue] \Circles;

    \begin{scope}
      \clip (A) circle[];
      \clip (B) circle[];
      \fill[CircleYellow] (A) circle[];
    \end{scope}
    \begin{scope}
      \clip (B) circle[];
      \clip (C) circle[];
      \fill[CircleYellow] (B) circle[];
    \end{scope}
    \begin{scope}
      \clip (C) circle[];
      \clip (A) circle[];
      \fill[CircleYellow] (C) circle[];
    \end{scope}

    \begin{scope}
      \clip (A) circle[];
      \clip (B) circle[];
      \clip (C) circle[];
      \fill[CircleOrange] (A) circle[];
    \end{scope}

    \draw[very thick] \Circles;
  \end{scope}
\end{tikzpicture}
\end{document}

Result

Step by step:

Animation

Generated by:

\documentclass{beamer}
\setbeamertemplate{navigation symbols}{}
\usepackage{tikz}

\definecolor{CircleBlue}{RGB}{0, 163, 232}
\definecolor{CircleYellow}{RGB}{254, 242, 0}
\definecolor{CircleOrange}{RGB}{255, 127, 38}

\begin{document}
\begin{frame}
\begin{tikzpicture}
  \def\Radius{10mm}
  \def\Distance{13mm}
  \path
    (0, 0) coordinate (C)
    +(120:\Distance) coordinate (A)
    +(60:\Distance) coordinate (B)
  ;
  \begin{scope}[radius=\Radius]
    \def\Circles{
      (A) circle[]
      (B) circle[]
      (C) circle[]
    }
    \uncover<2->{
      \fill[CircleBlue] \Circles;
    }

    \uncover<3->{
      \begin{scope}
        \clip (A) circle[];
        \clip (B) circle[];
        \fill[CircleYellow] (A) circle[];
      \end{scope}
    }
    \uncover<4->{
      \begin{scope}
        \clip (B) circle[];
        \clip (C) circle[];
        \fill[CircleYellow] (B) circle[];
      \end{scope}
    }
    \uncover<5->{
      \begin{scope}
        \clip (C) circle[];
        \clip (A) circle[];
        \fill[CircleYellow] (C) circle[];
      \end{scope}
    }

    \uncover<6->{
      \begin{scope}
        \clip (A) circle[];
        \clip (B) circle[];
        \clip (C) circle[];
        \fill[CircleOrange] (A) circle[];
      \end{scope}
    }

    \uncover<7->{
      \draw[very thick] \Circles;
    }
  \end{scope}
\end{tikzpicture}
\end{frame}
\end{document}
3

With venndiagrams, it's easy:

    \documentclass[svgnames]{article}
    \usepackage{venndiagram}

    \begin{document}

    \begin{venndiagram3sets}[ radius=1.5cm, overlap=1.2cm]%
        \setkeys{venn}{shade=DodgerBlue!80}
        \fillOnlyA \fillOnlyB \fillOnlyC
        \setkeys{venn}{shade=yellow}
        \fillACapBNotC \fillBCapCNotA \fillACapCNotB
        \setkeys{venn}{shade=orange}
        \fillACapBCapC
    \end{venndiagram3sets}

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