Skip to main content
Ctrl+K
You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Matplotlib 3.11.0.dev2324+ge4790d9dd documentation - Home Matplotlib 3.11.0.dev2324+ge4790d9dd documentation - Home
  • Plot types
  • User guide
  • Tutorials
  • Examples
  • Reference
  • Contribute
  • Releases
  • Gitter
  • Discourse
  • GitHub
  • Plot types
  • User guide
  • Tutorials
  • Examples
  • Reference
  • Contribute
  • Releases
  • Gitter
  • Discourse
  • GitHub

Section Navigation

  • Quick start guide
  • Frequently Asked Questions
  • Figures and backends
  • Axes and subplots
    • Introduction to Axes (or Subplots)
    • Arranging multiple Axes in a Figure
    • Placing colorbars
    • Axis autoscaling
    • Axis scales
    • Axis ticks
    • Plotting dates and strings
    • Legends
    • Subplot mosaic
    • Constrained layout guide
    • Tight layout guide (mildly discouraged)
  • Artists
  • Matplotlib configuration - rcParams
  • Customizing Matplotlib with style sheets and rcParams
  • Colors
  • Text
  • Animations using Matplotlib
  • User Toolkits
  • Getting started
  • Installation
  • Glossary
  • Using Matplotlib
  • Axes and subplots

Axes and subplots#

Matplotlib Axes are the gateway to creating your data visualizations. Once an Axes is placed on a figure there are many methods that can be used to add data to the Axes. An Axes typically has a pair of Axis Artists that define the data coordinate system, and include methods to add annotations like x- and y-labels, titles, and legends.

(Source code, 2x.png, png)

  • Introduction to Axes (or Subplots)
    • Creating Axes
    • Axes plotting methods
    • Axes labelling and annotation
    • Axes limits, scales, and ticking
    • Axes layout
  • Arranging multiple Axes in a Figure
  • Placing colorbars
  • Axis autoscaling
  • Axis scales
    • loglog and semilogx/y
    • Other built-in scales
    • Optional arguments for scales
    • Arbitrary function scales
    • What is a "scale"?
  • Axis ticks
    • Manual location and formats
    • Locators and Formatters
    • Styling ticks (tick parameters)
  • Plotting dates and strings
    • Date conversion
    • String conversion: categorical plots
    • Determine converter, formatter, and locator on an axis
    • More about "unit" support
  • Legends
    • Controlling the legend entries
    • Creating artists specifically for adding to the legend (aka. Proxy artists)
    • Legend location
    • Multiple legends on the same Axes
    • Legend handlers
  • Subplot mosaic
    • String short-hand
    • Axes spanning multiple rows/columns
    • Controlling mosaic creation
    • Controlling subplot creation
    • Nested list input
  • Constrained layout guide
  • Tight layout guide (mildly discouraged)

© Copyright 2002–2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012–2025 The Matplotlib development team.

Created using Sphinx 9.1.0.

Built from v3.10.8-2324-ge4790d9dd.

Built with the PyData Sphinx Theme 0.17.0.