Matplotlib: Line, Scatter, Histogram, Bar

The four plots that answer most first questions

40 min · interactive lesson with runnable code and 5 graded exercises.

What you'll be able to do

  • Create a figure and axes explicitly and know which is which
  • Pick the chart from the question: trend, relationship, distribution or comparison
  • Overlay groups fairly with alpha and density=True
  • Show class imbalance with counts and rates

The full lesson is free with an account.

One figure, one axes

Line plot

Scatter plot

Histogram

Bar chart and class imbalance

Picking the chart