Dates on x-axis
📖 Scenario: You work in a small bakery. You want to see how many cakes you sold each day last week. You have the dates and the number of cakes sold. You want to make a simple line chart with dates on the x-axis and cakes sold on the y-axis.
🎯 Goal: Create a line chart using matplotlib that shows the number of cakes sold each day last week. The x-axis should show the dates properly formatted.
📋 What You'll Learn
Create a list of dates for 7 days from 2024-04-01 to 2024-04-07
Create a list of integers for cakes sold each day
Use
matplotlib to plot the dates on the x-axis and cakes sold on the y-axisFormat the x-axis to show dates clearly
💡 Why This Matters
🌍 Real World
Plotting dates on the x-axis is common in sales, weather, finance, and many other fields where data changes over time.
💼 Career
Data scientists and analysts often need to visualize time series data clearly to find trends and patterns.
Progress0 / 4 steps