Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Below is a Venn diagram I created in TikZ. enter image description here

Here is the code. I want to now add a set E such that D is a proper subset of E and E is a proper subset of B. It is apparent that the set E cannot be drawn as a circle. At best, it can the boundary of E can be the arc on the right side of D, coupled with a different arc on the left side between the boundaries of B and D. And I want to have a different color for E, say yellow. What is the best way to go about?

\documentclass{article}

\usepackage{tikz}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}
    \begin{scope}[shift={(3cm,-5cm)}, fill opacity=0.5]
        \draw[fill=red, draw = black] (0,0) circle (5);
        \draw[fill=green, draw = black] (-1.5,0) circle (3);
    \draw[fill=blue, draw = black] (1.5,0) circle (3);
    \node at (0,4) (A) {\large\textbf{A}};
    \node at (-2,1) (B) {\large\textbf{B}};
    \node at (2,1) (C) {\large\textbf{C}};
    \node at (0,0) (D) {\large\textbf{D}};
    \end{scope}

\end{tikzpicture}
\end{document}
share|improve this question
1  
If I understnad what you want I'd recommend using the intersections library to locate the coordinates of the intersection, and then draw the arc using that. But might require you to use a pattern as it will totally obscure the D set. –  Peter Grill Oct 23 '12 at 1:07
    
You can also clip with circle B inside a scope to draw whatever you want to have but still contained in B. –  percusse Oct 23 '12 at 1:46
add comment

1 Answer

up vote 14 down vote accepted

Here's one possibility using the intersections library to find the coordinates of the intersection points between the two inner circles and then using the .. controls <point> and <point> .. syntax to draw the curve; some additional work with transparency groups was also done to obtain the proper coloring:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections}

\begin{document}
\pagestyle{empty}
\begin{tikzpicture}

\begin{scope}[shift={(3cm,-5cm)}, fill opacity=0.5,
  mytext/.style={text opacity=1,font=\large\bfseries}]

\draw[fill=red, draw = black] (0,0) circle (5);
\draw[fill=yellow, draw = black,name path=circle 1] (-1.5,0) circle (3);
\draw[fill=blue, draw = black,name path=circle 2] (1.5,0) circle (3);

\pgftransparencygroup
\clip (-1.5,0) circle (3);
\fill[green] (1.5,0) circle (3);
\filldraw[draw,fill=green,name intersections={of=circle 1 and circle 2}] (intersection-1) .. controls +(-4,1) and +(-4,-1) ..(intersection-2);
\endpgftransparencygroup

\node[mytext] at (0,4) (A) {A};
\node[mytext] at (-3.8,0) (B) {B};
\node[mytext] at (3.8,0) (C) {C};
\node[mytext] at (0,0) (D) {D};
\node[mytext] at (-2,1) (E) {E};
\end{scope}
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.