Basic plt.plot usage
📖 Scenario: You are a data analyst who wants to visualize the sales trend of a small shop over a week. You have the sales numbers for each day and want to create a simple line chart to see how sales changed.
🎯 Goal: Build a simple line plot using matplotlib.pyplot.plot to show sales over days.
📋 What You'll Learn
Create a list called
days with values: [1, 2, 3, 4, 5, 6, 7]Create a list called
sales with values: [150, 200, 170, 220, 180, 210, 230]Use
plt.plot(days, sales) to create the line plotUse
plt.show() to display the plot💡 Why This Matters
🌍 Real World
Line plots are used to visualize trends over time, like sales, temperature, or stock prices.
💼 Career
Data analysts and scientists use matplotlib to create charts that help explain data insights clearly.
Progress0 / 4 steps