2

I try to color the interception of two ellipses as simple as possible. I found some examples here:

Draw ellipses with different coloring for their intersection in tikz?

But I'm not sure how to integrate it in my project.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes}
\usetikzlibrary{patterns}
\usetikzlibrary{positioning}

\begin{document}
\begin{tikzpicture}[auto,node distance=4cm,>=latex',font=\sffamily]

\node[draw=blue!40,fill=blue!15,fill opacity=0.5,ellipse,minimum width=60mm,minimum height=35mm,align=center](master) at(0,0) {A};

\node[right=-15mm of master,pattern=north west lines,pattern color=blue,draw=blue!40,fill opacity=0.5,ellipse,minimum width=60mm,minimum height=35mm,align=center](slave) {B};

\node[below right=-3mm and -2mm of master,rotate=90,fill opacity=0.5] {C};

\end{tikzpicture}
\end{document}

enter image description here

PascalS
  • 826

1 Answers1

4

With the nice use path trick from this answer, you can just repeat what is done in this answer.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes}
\usetikzlibrary{patterns}
\usetikzlibrary{positioning}
\makeatletter
% from https://tex.stackexchange.com/a/127045/121799
\tikzset{use path/.code=\tikz@addmode{\pgfsyssoftpath@setcurrentpath#1}}
\makeatother
\begin{document}
\begin{tikzpicture}[auto,node distance=4cm,>=latex',font=\sffamily]

\node[draw=blue!40,fill=blue!15,fill opacity=0.5,ellipse,minimum
width=60mm,minimum height=35mm,align=center,
save path=\pathA](master) at(0,0) {A};

\node[right=-15mm of master,pattern=north west lines,pattern
color=blue,draw=blue!40,fill opacity=0.5,ellipse,minimum width=60mm,minimum
height=35mm,align=center,save path=\pathB](slave) {B};

\begin{scope}
\clip[use path=\pathA];
\fill[red] [use path=\pathB];
\end{scope}

\node[below right=-3mm and -2mm of master,rotate=90,fill opacity=0.5] {C};

\end{tikzpicture}
\end{document}

enter image description here