Skip to main content
Ctrl+K
Matplotlib 3.10.3 documentation - Home
  • Plot types
  • User guide
  • Tutorials
  • Examples
  • Reference
  • Contribute
  • Releases
  • Gitter
  • Discourse
  • GitHub
  • Twitter
  • Plot types
  • User guide
  • Tutorials
  • Examples
  • Reference
  • Contribute
  • Releases
  • Gitter
  • Discourse
  • GitHub
  • Twitter

Section Navigation

  • Quick start guide
  • Frequently Asked Questions
  • Figures and backends
    • Introduction to figures
    • Output backends
    • Matplotlib Application Interfaces (APIs)
    • Interacting with figures
    • Interactive figures and asynchronous programming
    • Event handling
    • Writing a backend -- the pyplot interface
  • Axes and subplots
    • Introduction to Axes (or Subplots)
    • Arranging multiple Axes in a Figure
    • Placing colorbars
    • Autoscaling axes
    • Axis scales
    • Axis ticks
    • Plotting dates and strings
    • Legends
    • Subplot mosaic
    • Constrained layout guide
    • Tight layout guide (mildly discouraged)
  • Artists
    • Introduction to Artists
    • Automated color cycle
    • Optimizing Artists for performance
    • Paths
    • Path effects guide
    • Understanding the extent keyword argument of imshow
    • Transformations Tutorial
  • Customizing Matplotlib with style sheets and rcParams
  • Colors
    • Specifying colors
    • Customized Colorbars Tutorial
    • Creating Colormaps in Matplotlib
    • Colormap normalization
    • Choosing Colormaps in Matplotlib
  • Text
    • Text in Matplotlib
    • Text properties and layout
    • Annotations
    • Fonts in Matplotlib
    • Writing mathematical expressions
    • Text rendering with XeLaTeX/LuaLaTeX via the pgf backend
    • Text rendering with LaTeX
  • Animations using Matplotlib
    • Animations using Matplotlib
    • Faster rendering by using blitting
  • User Toolkits
    • The axisartist toolkit
    • The axes_grid1 toolkit
    • The mplot3d toolkit
  • Getting started
  • Installation
    • Environment variables
    • Dependencies
  • 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
  • Autoscaling axes
  • 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 8.2.3.

Built from v3.10.3-2-g3b85ba4365.

Built with the PyData Sphinx Theme 0.15.4.