Skip to content

This project creates 3-circle Venn diagrams with custom text placement.

# Install the matplotlib-venn package
!pip install matplotlib-venn
Hidden output
import matplotlib.pyplot as plt
from matplotlib_venn import venn3

# fig, ax = plt.subplot()
# Create the Venn diagram
venn = venn3(subsets=(1, 1, 3, 5, 3, 3, 3), set_labels=('Scouting', 'Baseball\nCoaching', 'Data Science &\nSoftware Development'))

# Update the labels for the intersections
venn.get_label_by_id('100').set_text("25 Eagle Scouts")
venn.get_label_by_id('010').set_text("Winning Teams")
venn.get_label_by_id('001').set_text("Great Products")
venn.get_label_by_id('110').set_text("Communicating with Parents")
venn.get_label_by_id('101').set_text("Early Web Pages")
venn.get_label_by_id('011').set_text("Data Wrangling\nVisualizations")
venn.get_label_by_id('111').set_text("Skill Training\nMentoring\nCommunicating with Stakeholders")

# Set font size for the intersections
for label in venn.set_labels:
    label.set_fontsize(16)  # Font size for labels in the circles
for label in venn.subset_labels:
    label.set_fontsize(8)  # Font size for intersections

# Customize the diagram's appearance
#plt.title("David Navarre")
# Adjust the position of the 'IT' label (moving it higher)
venn.set_labels[2].set_position((venn.set_labels[2].get_position()[0], venn.set_labels[2].get_position()[1] + 0.4))
venn.set_labels[0].set_position((venn.set_labels[0].get_position()[0], venn.set_labels[0].get_position()[1] - 0.4))
venn.set_labels[1].set_position((venn.set_labels[1].get_position()[0], venn.set_labels[1].get_position()[1] - 0.46))
venn.subset_labels[0].set_position((venn.subset_labels[0].get_position()[0] + 0.04, venn.subset_labels[0].get_position()[1] - 0.05))
venn.subset_labels[1].set_position((venn.subset_labels[1].get_position()[0], venn.subset_labels[1].get_position()[1] - 0.05))
venn.subset_labels[2].set_position((venn.subset_labels[2].get_position()[0], venn.subset_labels[2].get_position()[1] + 0.05))
venn.subset_labels[3].set_position((venn.subset_labels[3].get_position()[0], venn.subset_labels[3].get_position()[1] - 0.1))
venn.subset_labels[4].set_position((venn.subset_labels[4].get_position()[0], venn.subset_labels[4].get_position()[1] - 0.05))
venn.subset_labels[5].set_position((venn.subset_labels[5].get_position()[0], venn.subset_labels[5].get_position()[1] - 0.05))
venn.subset_labels[6].set_position((venn.subset_labels[6].get_position()[0], venn.subset_labels[6].get_position()[1] + 0.05))


# Display the plot
plt.show()
#fig.savefig('Navarre Venn Diagram.jpg')
# Create the Venn diagram
venn = venn3(subsets=(2, 2, 1, 2, 1, 1, 1), set_labels=('C-Suite Advisory &\nBusiness Transformation', 'Executive Coaching', 'Executive Search'))

text100 = "HR transformation and organizational design\nMergers & acquisitions and leadership integration\nTalent management and executive succession planning\nBoard compensation committees and governance"

text010 = "Discover Phase\nCoachingExecution"
text001 = "Precision talent matching\n90-Day Fast-Start Integration\nRetention & Leadership Growth"
text111 = "Tom Lokar"

# Update the labels for the intersections
venn.get_label_by_id('100').set_text(text100)
venn.get_label_by_id('010').set_text(text010)
venn.get_label_by_id('001').set_text(text001)
venn.get_label_by_id('110').set_text("")
venn.get_label_by_id('101').set_text("")
venn.get_label_by_id('011').set_text("")
venn.get_label_by_id('111').set_text(text111)

# Set font size for the intersections
for label in venn.set_labels:
    label.set_fontsize(16)  # Font size for labels in the circles
for label in venn.subset_labels:
    label.set_fontsize(8)  # Font size for intersections

# Customize the diagram's appearance
#plt.title("David Navarre")
# Adjust the position of the 'IT' label (moving it higher)
#venn.set_labels[2].set_position((venn.set_labels[2].get_position()[0], #venn.set_labels[2].get_position()[1] + 0.4))
#venn.set_labels[0].set_position((venn.set_labels[0].get_position()[0], #venn.set_labels[0].get_position()[1] - 0.4))
#venn.set_labels[1].set_position((venn.set_labels[1].get_position()[0], #venn.set_labels[1].get_position()[1] - 0.4))

# Display the plot
plt.show()
# Create the Venn diagram
venn = venn3(subsets=(2, 2, 1, 2, 1, 1, 1), set_labels=('Left Set', 'Right Set', 'Bottom Set'))

# left circle
text100 = "left circle"
# right circle
text010 = "right circle"
# bottom circle
text001 = "bottom circle"
# top intersection
text110 = "top intersection"
# left intersection
text101 = "left intersection"
# right intersection
text011 = "right intersection"
#center
text111 = "center"

# Update the labels for the intersections
venn.get_label_by_id('100').set_text(text100)
venn.get_label_by_id('010').set_text(text010)
venn.get_label_by_id('001').set_text(text001)
venn.get_label_by_id('110').set_text(text110)
venn.get_label_by_id('101').set_text(text101)
venn.get_label_by_id('011').set_text(text011)
venn.get_label_by_id('111').set_text(text111)

# Set font size for the intersections
for label in venn.set_labels:
    label.set_fontsize(16)  # Font size for labels in the circles
for label in venn.subset_labels:
    label.set_fontsize(8)  # Font size for intersections