Bar chart color customization
📖 Scenario: You work in a small bakery and want to show how many cakes you sold each day last week. You want to make a bar chart to show this clearly to your team.
🎯 Goal: Create a bar chart using matplotlib that shows the number of cakes sold each day. Customize the colors of the bars so that each day has a different color.
📋 What You'll Learn
Create a dictionary called
sales with days of the week as keys and number of cakes sold as values.Create a list called
colors with a different color for each day.Use
matplotlib.pyplot.bar() to make a bar chart with the sales data and the colors list.Display the bar chart with
plt.show().💡 Why This Matters
🌍 Real World
Businesses often use bar charts to show sales or performance data clearly to teams and customers.
💼 Career
Data analysts and scientists use color customization in charts to make reports easier to understand and visually appealing.
Progress0 / 4 steps