1

enter image description hereI am trying to obtain something similar to the attached figure, however I am not getting all the intersections correctly colored, any help?

\documentclass[border=1mm]{standalone}
\usepackage{tikz}

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


\begin{document}
\begin{tikzpicture}
\draw (0cm,0cm) coordinate (RRH7) circle (4.5cm);
\draw (-6cm,0cm) coordinate (RRH1) circle (4.5cm);
\draw (-3cm,5.1962cm) coordinate (RRH6) circle (4.5cm);
\draw (3cm,5.1962cm) coordinate (RRH5) circle (4.5cm);
\draw (6cm,0cm) coordinate (RRH4) circle (4.5cm);
\draw (3cm,-5.1962cm) coordinate (RRH3) circle (4.5cm);
\draw (-3cm,-5.1962cm) coordinate (RRH2) circle (4.5cm);

\begin{scope}[radius=4.5cm]
    \def\Circles{
      (RRH1) circle[]
      (RRH2) circle[]
      (RRH3) circle[]
      (RRH4) circle[]
      (RRH5) circle[]
      (RRH6) circle[]
      (RRH7) circle[]
    }
   \fill[CircleBlue] \Circles;
    \begin{scope}
      \clip (RRH1) circle[];
      \clip (RRH2) circle[];
      \fill[CircleYellow] (RRH1) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH2) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH7) circle[];
      \clip (RRH1) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH1) circle[];
      \clip (RRH2) circle[];
      \clip (RRH7) circle[];
      \fill[CircleOrange] (RRH1) circle[];
    \end{scope}
    %%
    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH4) circle[];
      \fill[CircleYellow] (RRH5) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH7) circle[];
      \clip (RRH4) circle[];
      \fill[CircleYellow] (RRH4) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH4) circle[];
      \clip (RRH7) circle[];
      \fill[CircleOrange] (RRH4) circle[];
    \end{scope}
    %%%
    \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH3) circle[];
      \fill[CircleYellow] (RRH2) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH3) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH3) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH3) circle[];
      \clip (RRH7) circle[];
      \fill[CircleOrange] (RRH2) circle[];
    \end{scope}
    %%%
    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH6) circle[];
      \fill[CircleYellow] (RRH5) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH7) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH7) circle[];
      \clip (RRH6) circle[];
      \fill[CircleYellow] (RRH6) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH6) circle[];
      \clip (RRH7) circle[];
      \fill[CircleOrange] (RRH6) circle[];
    \end{scope}
    \draw[very thick] \Circles;
    \end{scope}
\end{tikzpicture}
\end{document}
  • Formatted code must be incremented by 4 spaces. I edited to do so. Can you please check the above indeed reflects your code ? – marsupilam Aug 14 '17 at 11:38
  • 1
    You posted the same question yesterday. Did you delete it? – JPi Aug 14 '17 at 11:40
1

You have to fill in orange last. I also change the positioning to polar coordinates and renamed the shapes.

Edit: Further improved code. You should take a look at the \clip documentation.

\documentclass[border=1mm]{standalone}
\usepackage{tikz}

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


\begin{document}


\begin{tikzpicture}
\draw (0cm,0cm) coordinate (RRH7) circle (4.5cm);
\draw (0:6cm)   coordinate (RRH1) circle (4.5cm);
\draw (60:6cm)  coordinate (RRH2) circle (4.5cm);
\draw (120:6cm) coordinate (RRH3) circle (4.5cm);
\draw (180:6cm) coordinate (RRH4) circle (4.5cm);
\draw (240:6cm) coordinate (RRH5) circle (4.5cm);
\draw (300:6cm) coordinate (RRH6) circle (4.5cm);

\begin{scope}[radius=4.5cm]
    \def\Circles{
      (RRH1) circle[]
      (RRH2) circle[]
      (RRH3) circle[]
      (RRH4) circle[]
      (RRH5) circle[]
      (RRH6) circle[]
      (RRH7) circle[]
    }
   \fill[CircleBlue] \Circles;
    \begin{scope}
      \clip (RRH1) circle[];
      \fill[CircleYellow] (RRH2) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH2) circle[];
      \fill[CircleYellow] (RRH3) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH3) circle[];
      \fill[CircleYellow] (RRH4) circle[];
    \end{scope}
    %%
    \begin{scope}
      \clip (RRH4) circle[];
      \fill[CircleYellow] (RRH5) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH5) circle[];
      \fill[CircleYellow] (RRH6) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH6) circle[];
      \fill[CircleYellow] (RRH1) circle[];
    \end{scope}
    %%%
    \begin{scope}
      \clip (RRH1) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH2) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH3) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    %%%
    \begin{scope}
      \clip (RRH4) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH5) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}
    \begin{scope}
      \clip (RRH6) circle[];
      \fill[CircleYellow] (RRH7) circle[];
    \end{scope}

    \begin{scope}
      \clip (RRH1) circle[];
      \clip (RRH2) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH2) circle[];
      \clip (RRH3) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH3) circle[];
      \clip (RRH4) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH4) circle[];
      \clip (RRH5) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH6) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH5) circle[];
      \clip (RRH6) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
      \begin{scope}
      \clip (RRH6) circle[];
      \clip (RRH1) circle[];
      \fill[CircleOrange] (RRH7) circle[];
    \end{scope}
    \draw[very thick] \Circles;
    \end{scope}
\end{tikzpicture}
\end{document}

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.