Matplotlib

The standard plotting library for Python.

Matplotlib is taught here in 12 lessons, running from Figures, axes and your first plot through to Debugging plots: empty axes, missing data and overlap. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.

TrackPython & Data Science
Lessons12
LevelBeginner to intermediate
Reading timeabout 3 hours
PrerequisitesHelpful, but not required: pandas

Lessons

  1. Figures, axes and your first plotThe object model behind every Matplotlib plot, and how to avoid the state-machine habits that cause inconsistent charts.
  2. Styling, subplots and savingConsistent colours and themes, multi-panel figures that stay readable, and exporting images at the right size.
  3. Backends and environment setupWhat a backend actually is, how to choose between interactive and headless, and how to make charts work in notebooks, servers and CI.
  4. Chart types: bar, scatter, histogram, pie and boxThe everyday chart functions, the arguments that matter, and the specific ways each chart can mislead a reader.
  5. Titles, legends, annotations and textLabel axes properly, place legends without fighting the layout, and point at data with annotations in the right coordinate system.
  6. Scales, ticks and date axesLog and symmetric-log scales, tick locators and formatters, and getting date and category axes to read the way you intend.
  7. Colormaps, colour mapping and accessibilityNormalisation, colorbars and the choice of palette — the part of a chart that decides whether the numbers are readable.
  8. Images and 3D: imshow, contour and mplot3dGridded data on a colour scale, contour lines you can read, and the honest limits of a 3-D surface plot.
  9. Plotting directly from pandas and NumPyWhat df.plot actually does under the hood, how to combine it with manual axes work, and where pandas stops being enough.
  10. Animations and interactive figuresBuild a frame-by-frame animation, export it to video, and add sliders and pan/zoom without fighting the event loop.
  11. Publication quality: DPI, vector formats and layoutInches and dots per inch without guessing, vector export with embedded fonts, and multi-panel figures that survive review.
  12. Debugging plots: empty axes, missing data and overlapWhy a line vanishes, how to stop labels colliding, and how to inspect the artist tree when the picture does not match your intent.

More in Python & Data Science

Python 3 NumPy pandas Jupyter Notebook Flask FastAPI Django SciPy Pillow Python 2.x R Julia

FAQ

How long does the Matplotlib course take?
It has 12 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for Matplotlib?
Not strictly. It helps to have read pandas first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after Matplotlib?
Continue with Jupyter Notebook (11 lessons), the next course in Python & Data Science.