← all tracks

Matplotlib

Figures, axes and artists — what actually draws your chart.

20 of 20 lessons built·0 of 62 exercises solved
Module 1

Foundations

4/4

The objects a chart is made of, and the two APIs for reaching them.

  1. 1

    Figure, Axes and Artist

    Every matplotlib question is really “which object owns this?”

  2. 2

    plt versus ax

    Why half the examples online look nothing like the other half

  3. 3

    Your first plot

    Six lines, and five of them are about being readable

  4. 4

    Showing and saving

    Backends, the blank-file trap, and getting a file worth sending

Module 2

The plot types

4/4

Lines, scatters, bars and distributions — and which question each answers.

  1. 5

    Lines

    What the segment between two points is actually claiming

  2. 6

    Scatter plots

    Do these two columns move together — and how much can you read into that

  3. 7

    Bar charts

    Sort them, turn them sideways, and never cut the baseline

  4. 8

    Distributions

    What one column looks like before you average it

Module 3

Making it readable

4/4

Labels, scales, colour and annotation.

  1. 9

    Ticks and labels

    Locators say where, formatters say what — almost every tick problem is one of the two

  2. 10

    Scales and limits

    Log axes, zero baselines, and why twin axes can prove anything

  3. 11

    Colour

    Three families, and picking the wrong one invents structure that is not there

  4. 12

    Annotation

    Where a chart stops showing data and starts making a claim

Module 4

Layout

3/3

Several plots in one figure, and getting them to fit.

  1. 13

    Subplot grids

    Small multiples, and the array shape that breaks your loop

  2. 14

    Uneven layouts

    Draw the arrangement you want and get back Axes named after it

  3. 15

    Making it fit

    constrained layout, figure-level labels, and one legend for the lot

Module 5

In practice

3/3

Styles, pandas integration, and exporting for real use.

  1. 16

    Styles and rcParams

    Decide how your charts look once, in one place

  2. 17

    Plotting from pandas

    df.plot() is a shortcut into matplotlib, not an alternative to it

  3. 18

    Charts you can reuse

    The ax=None convention, and sizing a figure for where it is going

Module 6

Capstones

2/2

A dashboard, and a figure fit to publish.

  1. 19

    Capstone: a dashboard

    capstone

    Four questions, four panels, one figure that fits on a page

  2. 20

    Capstone: a figure fit to publish

    capstone

    One claim, one chart, and everything that does not serve it removed