<br>This works for four events and their intersections but how do i add the fifth event along with all intersections? <br>
<br>
from matplotlib import pyplot as plt<br>
from matplotlib.patches import Circle<br>
<br>
f = plt.figure()<br>
ax = f.gca()<br>
rad = 1.4<br>
c1 = Circle((-1,0),rad, alpha=.2, fc =&#39;red&#39;)<br>
c2 = Circle((1,0),rad, alpha=.2, fc =&#39;blue&#39;)<br>
c3 = Circle((0,1),rad, alpha=.2, fc =&#39;green&#39;)<br>
c4 = Circle((0,-1),rad, alpha=.2, fc =&#39;yellow&#39;)<br>
ax.add_patch(c1)<br>
ax.add_patch(c2)<br>
ax.add_patch(c3)<br>
ax.add_patch(c4)<br>
ax.set_xlim(-3,3)<br>
ax.set_ylim(-3,3)<br>
plt.show() <br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Vikram K</b> <span dir="ltr">&lt;<a href="mailto:kpguy1975@gmail.com">kpguy1975@gmail.com</a>&gt;</span><br>
Date: Fri, May 6, 2011 at 7:48 AM<br>Subject: Venn diagram for five events<br>To: <a href="mailto:baypiggies@python.org">baypiggies@python.org</a><br><br><br>I sent the following query to the matplotlib list a while back. I would appreciate it if someone here can answer my question. Also, is there an alternative to matplotlib for this kind of a problem? <br>
-------<br><br>I wish to draw a Venn diagram depicting five events and their 
intersections. I came across some code for three events--could someone 
please direct me about how i could modify it for five events.<br><br>from matplotlib import pyplot as plt<br>
from matplotlib.patches import Circle<br><br>f = plt.figure()<br>ax = f.gca()<br>rad = 1.4<br>c1 = Circle((-1,0),rad, alpha=.2, fc =&#39;red&#39;)<br>c2 = Circle((1,0),rad, alpha=.2, fc =&#39;blue&#39;)<br>c3 = Circle((0,1),rad, alpha=.2, fc =&#39;green&#39;)<br>


ax.add_patch(c1)<br>ax.add_patch(c2)<br>ax.add_patch(c3)<br>ax.set_xlim(-3,3)<br>ax.set_ylim(-3,3)<br>plt.show() 
</div><br>