Error bars on bar charts
📖 Scenario: You work in a small bakery that tracks daily sales of different types of bread. You want to show the average sales for each bread type along with how much the sales vary each day.
🎯 Goal: Create a bar chart showing average sales for each bread type with error bars representing the daily sales variation.
📋 What You'll Learn
Create a dictionary called
daily_sales with bread types as keys and lists of daily sales numbers as values.Create a variable called
average_sales that stores the average sales for each bread type.Create a variable called
sales_std that stores the standard deviation of sales for each bread type.Use
matplotlib to plot a bar chart with error bars using average_sales and sales_std.Display the bar chart with labels for bread types and a title.
💡 Why This Matters
🌍 Real World
Bakers and shop owners use sales charts with error bars to understand average sales and variability, helping with inventory and production planning.
💼 Career
Data analysts and business intelligence professionals often create charts with error bars to communicate data variability clearly to stakeholders.
Progress0 / 4 steps