Donut Plot

logo of a chart:Doughnut

A Donut chart is essentially a Pie Chart with an area of the center cut out. You can build one hacking the plt.pie() function of the matplotlib library as shown in the examples below.

⏱ Quick start

# library
import matplotlib.pyplot as plt

# create data
size_of_groups=[12,11,3,30]

# Create a pieplot
plt.pie(size_of_groups)

# add a circle at the center to transform it in a donut chart
my_circle=plt.Circle( (0,0), 0.7, color='white')
p=plt.gcf()
p.gca().add_artist(my_circle)

plt.show()

Matplotlib logoDonut plot with Matplotlib

The example above is a good start but you probably need to go further. The blog posts linked below explain common tasks like adding and customizing labels, change section colors, add padding between each and more.

🚨 Grab the Data To Viz poster!


Do you know all the chart types? Do you know which one you should pick? I made a decision tree that answers those questions. You can download it for free!

    dataviz decision tree poster