Why Pie Charts Show Proportions
📖 Scenario: Imagine you run a small bakery and want to understand which types of pastries sell the most. You have sales data for different pastry types and want to visualize their share of total sales.
🎯 Goal: You will create a pie chart using matplotlib to show the proportions of pastry sales. This will help you see which pastries are most popular at a glance.
📋 What You'll Learn
Create a dictionary called
pastry_sales with exact pastry names and sales numbersCreate a variable called
total_sales that sums all salesUse a
for loop with variables pastry and sales to calculate proportionsUse
matplotlib.pyplot.pie() to create a pie chart showing proportionsPrint the proportions dictionary to see the share of each pastry
💡 Why This Matters
🌍 Real World
Pie charts are used in business to quickly show how parts make up a whole, like sales shares or budget spending.
💼 Career
Data analysts and scientists use pie charts to communicate proportions clearly to stakeholders and help make decisions.
Progress0 / 4 steps