Python Plotting Foundation
Matplotlib Topic 14 Foundation

Turn numbers into pictures people understand

Matplotlib draws charts on a figure. Pick the chart that matches the story: trend, comparison, or relationship.

Picture this: numbers become a picture

You pass x and y. Matplotlib draws points, lines, or bars.

datax, y lists
→
plt.plot / barchoose chart
→
labelstitle, axes
→
figurewhat you see

In easy words

You give Matplotlib lists of numbers. It paints lines, bars, or dots. Labels on axes tell the viewer what the picture means.

Diagram — data → chart

x, y arrays plt.plot / bar figure

Where this shows up

Dashboards, lab reports, product metrics, ML training curves, experiment comparisons.

Key facts

  • Figure + axes — Canvas and the drawing area.
  • Line — Change over ordered x (often time).
  • Bar — Compare categories side by side.
  • Scatter — Relationship between two measures.

What to remember

  • Import — import matplotlib.pyplot as plt
  • Show — plt.show() displays the chart
  • Label always — title / xlabel / ylabel for shared charts
  • Match lengths — x and y must be same length
Pick a chart type

Chart switcher

Choose Line / Bar / Scatter

Plotting — Topic Quiz

Check understanding

Answer all questions, then click Check answers. Use this before Practice in the editor.

Q1. Matplotlib’s common alias is…

Q2. A line chart is best for…

Q3. Bar charts compare…

Q4. Scatter plots show…

Score: —