Python Matplotlib

Matplotlib Pie Charts

Pie charts

Matplotlib Pie Charts

You can create pie charts with the pie() function.

Pie Chart

import matplotlib.pyplot as plt

y = [35, 25, 25, 15]

plt.pie(y)
plt.show()

Matplotlib — Knowledge Check

Check your understanding of this section. Results are not saved—refresh the page to start over.

1. Matplotlib is primarily used for:
2. pyplot is often imported as:
3. plt.plot() is commonly used for:
4. plt.show() does what in a script?
5. Subplots let you: