Skip to content
dreamcode
dreamcode
Back to map
Data plotting · Lesson 43 of 44
+15 XP on finish
PYTHON APPLIED

Visualizing data with Matplotlib

Matplotlib is Python's foundational plotting library. Its pyplot interface lets you create line plots, bar charts, scatter plots, and histograms with just a few function calls.

How it reads
plt.plot(x, y) draws a line chart connecting the data points
marker='o' adds circular markers at each data point
plt.savefig('temps.png') saves the chart to an image file
Cloud tip: For quick DataFrame plots, use df.plot() directly. It calls Matplotlib under the hood but saves you from manual axis setup.
Check your understanding
Answer all 3 to complete this lesson · +15 XP
1. Which function creates a line chart in Matplotlib?
2. How do you save a Matplotlib chart to a file?
3. Which chart type is best for comparing category counts?