Why Line Plots Show Trends
📖 Scenario: Imagine you are a weather observer who wants to understand how temperature changes over a week. You have recorded the temperature each day and want to see if it is getting warmer or colder.
🎯 Goal: You will create a simple line plot using matplotlib to visualize temperature changes over days. This will help you see the trend of temperature rising or falling.
📋 What You'll Learn
Create a list called
days with values from 1 to 7 representing days of the weekCreate a list called
temperatures with exact values: 22, 21, 23, 24, 26, 27, 28Use
matplotlib.pyplot to plot days on the x-axis and temperatures on the y-axisAdd labels for x-axis as
'Day' and y-axis as 'Temperature (°C)'Add a title
'Temperature Trend Over a Week'Display the plot
💡 Why This Matters
🌍 Real World
Line plots are used in weather forecasting, stock market analysis, and health monitoring to see how values change over time.
💼 Career
Data scientists and analysts use line plots to quickly understand trends and patterns in data, which helps in making decisions.
Progress0 / 4 steps