GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Installation
  • Documentation
  • Examples
  • Tutorials
  • Contributing

This view

  • Original page
  • New address

GeezerVison is showing matplotlib.org — matplotlib.pyplot.subplot2grid — Matplotlib 3.1.2 documentation

You are reading an old version of the documentation (v3.1.1). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplot2grid.html
Version 3.1.2
matplotlib
Fork me on GitHub

Navigation

  • index
  • modules |
  • next |
  • previous |
  • home| 
  • contents »
  • API Overview »
  • matplotlib.pyplot »
  • matplotlib.pyplot »

Quick search

Table of Contents

  • matplotlib.pyplot.subplot2grid
    • Examples using matplotlib.pyplot.subplot2grid

Related Topics

  • Documentation overview
    • API Overview
      • matplotlib.pyplot
        • matplotlib.pyplot
          • Previous: matplotlib.pyplot.subplot
          • Next: matplotlib.pyplot.subplot_tool
Show Page Source

matplotlib.pyplot.subplot2grid¶

matplotlib.pyplot.subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs)[source]¶

Create an axis at specific location inside a regular grid.

Parameters:
shape : sequence of 2 ints

Shape of grid in which to place axis. First entry is number of rows, second entry is number of columns.

loc : sequence of 2 ints

Location to place axis within grid. First entry is row number, second entry is column number.

rowspan : int

Number of rows for the axis to span to the right.

colspan : int

Number of columns for the axis to span downwards.

fig : Figure, optional

Figure to place axis in. Defaults to current figure.

**kwargs

Additional keyword arguments are handed to add_subplot.

Notes

The following call

subplot2grid(shape, loc, rowspan=1, colspan=1)

is identical to

gridspec=GridSpec(shape[0], shape[1])
subplotspec=gridspec.new_subplotspec(loc, rowspan, colspan)
subplot(subplotspec)

Examples using matplotlib.pyplot.subplot2grid¶

../../_images/sphx_glr_demo_tight_layout_thumb.png

Resizing axes with tight layout

../../_images/sphx_glr_demo_gridspec01_thumb.png

subplot2grid demo

../../_images/sphx_glr_constrainedlayout_guide_thumb.png

Constrained Layout Guide

../../_images/sphx_glr_tight_layout_guide_thumb.png

Tight Layout guide

© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2018 The Matplotlib development team.
Last updated on Jan 05, 2020. Created using Sphinx 1.8.5. Doc version v3.1.1-79-g90d53b526.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.