Atlas · skill

Matplotlib

Matplotlib is a Python plotting library for constructing and exporting figures through explicit control of axes, marks and layout. Competence means translating data into accurate visual encodings and managing scales, annotations and output formats so a figure remains interpretable both onscreen and in a report.

toolPython Data Libraries

What it is

Matplotlib organizes a figure into axes containing artists such as lines, bars, images and text. Its object-oriented interface gives direct control over individual axes, while the pyplot interface provides convenient stateful commands. Axis limits, transforms, normalization and aspect ratio determine how values become positions and colors. These choices are part of the analytical meaning, not only styling. The library supports many plotting primitives and is used beneath higher-level tools such as Seaborn; it supplies rendering control rather than choosing a statistically appropriate display automatically.

What the work involves

The practitioner identifies the comparison a figure should support, chooses a suitable mark and sets labels, units and scales explicitly. They represent uncertainty when relevant, keep legends and color mappings consistent and make multiple panels comparable. They inspect clipping, text size and layout in the actual export format. The deliverable is a readable figure and reproducible plotting code, with visual choices tied to the data and decision rather than default settings that happen to fit in a notebook output.

Illustrative example

A researcher compares model residuals across three operating regimes. They create axes with shared ranges, plot residuals against observed values and add a clearly labeled zero line. The same color identifies each regime in the scatterplots and distribution panel. After exporting to PDF and PNG, they inspect the figure at report size to ensure that labels remain legible and extreme residuals have not been clipped.

Limits and common mistakes

Stateful plotting can accidentally reuse axes or settings, and autoscaling can make separate panels appear comparable when they are not. Dense scatterplots can hide concentrations; misleading normalization can exaggerate differences. Exported text and colors may behave differently from the notebook preview. Check plotted data, scale choices, accessible contrast and final layout. Matplotlib skill concerns constructing faithful figures, while statistical interpretation and narrative require additional judgment.

Prerequisites

No prerequisites.

Related skills

Sources and further reading

  • Using Matplotlib

    Documents figure and axes architecture, plotting interfaces, transformations and export.

Last updated: 2026-10-10