Learning path

Matplotlib basics

Draw your first charts with pyplot, add labels, legends, colors and several charts in one figure, and learn the four everyday chart types.

9 lessons

Start the path →
  1. Lesson Matplotlib pyplot Basics: plt.plot and plt.show Plot a graph in Python in a few lines with matplotlib.pyplot: plt.plot, plt.title, plt.xlabel and plt.show.
  2. Lesson Plot a Line Graph in Python Draw a smooth line graph from NumPy data with plt.subplots and ax.plot.
  3. Lesson Titles, Labels, and Legends Explain a chart with a title, axis labels, a legend and a grid.
  4. Lesson Colors, Line Styles, and Markers Change the color, line style, line width and markers of each line.
  5. Lesson Several Charts in One Figure Arrange a grid of charts with plt.subplots(rows, columns).
  6. Lesson Bar Charts Compare values across categories with vertical and horizontal bars.
  7. Lesson Scatter Plots Show the relationship between two variables with ax.scatter.
  8. Lesson Histograms See how values are distributed by grouping them into bins.
  9. Lesson Pie Charts Show parts of a whole with ax.pie, percentages and an exploded slice.