Exploding slices
📖 Scenario: You are preparing a pie chart to show the favorite fruits of a group of people. You want to highlight one fruit by pulling its slice out from the pie chart.
🎯 Goal: Create a pie chart with slices representing fruit counts. Then, explode the slice for the fruit with the highest count to make it stand out.
📋 What You'll Learn
Create a dictionary called
fruit_counts with exact entries for fruits and their countsCreate a list called
explode to control which slice is explodedUse
matplotlib.pyplot.pie() with the explode parameter to create the pie chartPrint the
explode list to show which slice is exploded💡 Why This Matters
🌍 Real World
Pie charts are used in reports and presentations to show parts of a whole. Exploding slices helps highlight important categories.
💼 Career
Data analysts and scientists often use pie charts to communicate data insights clearly and attractively.
Progress0 / 4 steps