I have the following pie chart:
There are 2 labels on top overlapping. Is it possible to move a little bit up the first one? Moreover, how can I add a "connecting line" from the part of the pie to each label? Here is the code I'm using:
import matplotlib.pyplot as plt
import colorsys
labels = 'Control & Handling of Events', 'Arch. Structures & Viewpoints', 'Distribution of Components', 'Arch. Styles', 'Concurrency', 'Interaction & Presentation', 'Error & Exeption Handling', 'Fam. of Prog. & Frameworks','Security & Safety', 'Design Patterns', 'Arch. Design Decisions', 'Data Persistence'
sizes = [59, 40, 21, 21, 19, 17, 11, 8, 8, 5, 4, 4]
colors = ['#00305d','#003d69','#014b76','#025883', '#03668f','#04749c','#0481a9','#058fb6', '#069dc2','#07aacf','#08b8dc','#09c6e9']
fig1, ax1 = plt.subplots()
ax1.pie(sizes, colors=colors, labels=['%s, (%1.1f%%)' % (l, s) for l, s in zip(labels, sizes)], shadow=False, textprops={'color':"k", 'fontsize': 16}, startangle=90, pctdistance=0.8, labeldistance=1.05)
ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
plt.show()
I tried to increase the size of the labels with textprops
but increasing fontsize
doesn't change the font.
Thanks for the help.