1# library
2import matplotlib.pyplot as plt
3
4# create data
5size_of_groups=[12,11,3,30]
6
7# Create a pieplot
8plt.pie(size_of_groups)
9
10# add a circle at the center to transform it in a donut chart
11my_circle=plt.Circle( (0,0), 0.7, color='white')
12p=plt.gcf()
13p.gca().add_artist(my_circle)
14
15plt.show()
16