<spanid="gridspec-guide"></span><h1>Customizing Location of Subplot Using GridSpec<aclass="headerlink" href="#customizing-location-of-subplot-using-gridspec" title="Permalink to this headline">¶</a></h1>
<dd>a helper function that is similar to <aclass="reference internal" href="../api/pyplot_api.html#matplotlib.pyplot.subplot" title="matplotlib.pyplot.subplot"><codeclass="xref py py-func docutils literal"><spanclass="pre">subplot()</span></code></a>
but uses 0-based indexing and let subplot to occupy multiple cells.</dd>
<h2>Basic Example of using subplot2grid<aclass="headerlink" href="#basic-example-of-using-subplot2grid" title="Permalink to this headline">¶</a></h2>
<p>To use <aclass="reference internal" href="../api/pyplot_api.html#matplotlib.pyplot.subplot2grid" title="matplotlib.pyplot.subplot2grid"><codeclass="xref py py-func docutils literal"><spanclass="pre">subplot2grid()</span></code></a>, you provide geometry of
the grid and the location of the subplot in the grid. For a simple
<h2>GridSpec and SubplotSpec<aclass="headerlink" href="#gridspec-and-subplotspec" title="Permalink to this headline">¶</a></h2>
<p>You can create <aclass="reference internal" href="../api/gridspec_api.html#matplotlib.gridspec.GridSpec" title="matplotlib.gridspec.GridSpec"><codeclass="xref py py-class docutils literal"><spanclass="pre">GridSpec</span></code></a> explicitly and use
<p>This is similar to <aclass="reference internal" href="../api/pyplot_api.html#matplotlib.pyplot.subplots_adjust" title="matplotlib.pyplot.subplots_adjust"><codeclass="xref py py-func docutils literal"><spanclass="pre">subplots_adjust()</span></code></a>, but it only
affects the subplots that are created from the given GridSpec.</p>
<h2>GridSpec using SubplotSpec<aclass="headerlink" href="#gridspec-using-subplotspec" title="Permalink to this headline">¶</a></h2>
<p>You can create GridSpec from the <aclass="reference internal" href="../api/gridspec_api.html#matplotlib.gridspec.SubplotSpec" title="matplotlib.gridspec.SubplotSpec"><codeclass="xref py py-class docutils literal"><spanclass="pre">SubplotSpec</span></code></a>,
in which case its layout parameters are set to that of the location of
<h2>A Complex Nested GridSpec using SubplotSpec<aclass="headerlink" href="#a-complex-nested-gridspec-using-subplotspec" title="Permalink to this headline">¶</a></h2>
<p>Here’s a more sophisticated example of nested GridSpec where we put
a box around each cell of the outer 4x4 grid, by hiding appropriate