Python MatplotlibLesson 68Free preview
Matplotlib Pie Charts
This lesson is part of Python · All levels
Summary
Pie charts display the composition of each part against the entire data, so it is suitable to divide the proportion as market share. The explode parameter pulls some of the iris out to highlight it, while the autopct displays a percentage on each slice. Pie charts are most accurately used when the number of categories is small and the total is meaningful as a whole.
Key points
- Pie charts visualize the proportion of each category to the total
- Labels give names, explode highlights slices, startangle spins the starting position
- The autopct shows a percentage on each slice
- Only if the number of categories is small and the total is significant
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.