0
0
Matplotlibdata~15 mins

What is Matplotlib - Hands-On Activity

Choose your learning style9 modes available
What is Matplotlib
📖 Scenario: You want to create simple pictures from data to understand it better. Imagine you have numbers about daily temperatures and want to see them as a line going up and down. This helps you see patterns quickly.
🎯 Goal: Learn how to use Matplotlib to make a simple line chart from a list of numbers.
📋 What You'll Learn
Create a list of numbers representing data
Import Matplotlib's pyplot module
Use pyplot to make a line chart from the data
Show the chart on the screen
💡 Why This Matters
🌍 Real World
People use Matplotlib to see patterns in data like sales, weather, or sports scores.
💼 Career
Data scientists and analysts use Matplotlib to explain data clearly to others.
Progress0 / 4 steps
1
Create a list of numbers
Create a list called temperatures with these exact values: [22, 24, 19, 23, 25, 20, 21].
Matplotlib
Need a hint?

Use square brackets [] to make a list and separate numbers with commas.

2
Import Matplotlib's pyplot
Write the exact line import matplotlib.pyplot as plt to import pyplot from Matplotlib and call it plt.
Matplotlib
Need a hint?

Use the exact import statement to access plotting functions easily.

3
Create a line chart from the data
Use plt.plot(temperatures) to create a line chart from the temperatures list.
Matplotlib
Need a hint?

Use the plot function from plt and pass the list of numbers.

4
Show the chart on the screen
Use plt.show() to display the line chart you created.
Matplotlib
Need a hint?

Call the show function to open a window with your chart.