Why Multiple Plots Per Figure Matter
📖 Scenario: Imagine you are a data analyst working for a small bakery. You want to compare the sales of different types of bread over a week. Instead of making separate charts for each bread type, you want to put all sales charts in one figure to see the differences side by side easily.
🎯 Goal: You will create a figure with multiple plots (subplots) using matplotlib. This will help you compare sales data for different bread types in one place.
📋 What You'll Learn
Create a dictionary called
sales_data with bread types as keys and a list of 7 daily sales numbers as values.Create a variable called
days that holds a list of strings representing the days of the week.Use
matplotlib.pyplot.subplots() to create a figure with 3 subplots arranged in one row.Plot the sales data for each bread type on its own subplot with appropriate titles.
Display the figure with all subplots visible.
💡 Why This Matters
🌍 Real World
Data analysts often need to compare multiple related datasets side by side to find patterns or differences quickly.
💼 Career
Creating multiple plots per figure is a common skill for data visualization roles, helping communicate insights clearly to teams and clients.
Progress0 / 4 steps