Basic pie chart with plt.pie
📖 Scenario: You work in a small bakery and want to show which types of bread sell the most. You have the sales numbers for different bread types.
🎯 Goal: Create a pie chart using plt.pie to show the sales distribution of bread types.
📋 What You'll Learn
Create a dictionary called
bread_sales with exact keys and valuesCreate a list called
labels from the dictionary keysCreate a list called
sizes from the dictionary valuesUse
plt.pie with sizes and labels to make the pie chartDisplay the pie chart with
plt.show()💡 Why This Matters
🌍 Real World
Pie charts help businesses quickly see how parts contribute to a whole, like sales of different products.
💼 Career
Data analysts and scientists often use pie charts to present categorical data visually to stakeholders.
Progress0 / 4 steps