Most basic pie chart with Matplotlib
The matplotlib library allows to easily build a pie chart thanks to its pie() function. It expects at the very least some data input. This data must be an array of numbers as in the example below:
Add labels
The above pie chart is a good start but is definitely not very insightful. The first thing we miss here are labels.
Labels are added thanks to the labels parameter that expect an array of strings. You also problably want to play with the labeldistance parameter that controls the distance between the circle edge and the label itself. (1= exactly on it, use something bigger to have the label further.)
Customize wedges
It is pretty common to customize wedges to get some blank spaces around them. This is doable thanks to the wedgeprops parameter. This parameter is an object that accept 2 properties: linewidth and edgecolor
Customize colors
You can change the color palette in use thanks to the color parameter that expects an array of color. See the dedicated section of the gallery for more tips on color with matplotlib.