Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > bf21b4394f4d7fa09e3626145d3315e0 > files > 700

python-matplotlib-doc-1.2.0-14.fc18.i686.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>colorbar &mdash; Matplotlib 1.2.0 documentation</title>
    
    <link rel="stylesheet" href="../_static/mpl.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.2.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Matplotlib 1.2.0 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="top" title="Matplotlib 1.2.0 documentation" href="../index.html" />
    <link rel="up" title="The Matplotlib API" href="index.html" />
    <link rel="next" title="colors" href="colors_api.html" />
    <link rel="prev" title="collections" href="collections_api.html" /> 
  </head>
  <body>
<!-- Piwik -->
<script type="text/javascript">
if ("matplotlib.sourceforge.net" == document.location.hostname ||
    "matplotlib.sf.net" == document.location.hostname) {
  var pkBaseURL = (("https:" == document.location.protocol) ? "https://apps.sourceforge.net/piwik/matplotlib/" : "http://apps.sourceforge.net/piwik/matplotlib/");
  document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
<script type="text/javascript">
if ("matplotlib.sourceforge.net" == document.location.hostname ||
    "matplotlib.sf.net" == document.location.hostname) {
  piwik_action_name = '';
  piwik_idsite = 1;
  piwik_url = pkBaseURL + "piwik.php";
  piwik_log(piwik_action_name, piwik_idsite, piwik_url);
  document.write(unescape('%3Cobject%3E%3Cnoscript%3E%3Cp%3E%3Cimg src="http://apps.sourceforge.net/piwik/matplotlib/piwik.php?idsite=1" alt="piwik"/%3E%3C/p%3E%3C/noscript%3E%3C/object%3E'));
}
</script>
<!-- End Piwik Tag -->
<link rel="shortcut icon" href="_static/favicon.ico">

<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="../index.html"><img src="../_static/logo2.png" border="0" alt="matplotlib"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="colors_api.html" title="colors"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="collections_api.html" title="collections"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">home</a>|&nbsp;</li>
        <li><a href="../search.html">search</a>|&nbsp;</li>
        <li><a href="../examples/index.html">examples</a>|&nbsp;</li>
        <li><a href="../gallery.html">gallery</a>|&nbsp;</li>
        <li><a href="../contents.html">docs</a> &raquo;</li>

          <li><a href="index.html" accesskey="U">The Matplotlib API</a> &raquo;</li> 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">colorbar</a><ul>
<li><a class="reference internal" href="#module-matplotlib.colorbar"><tt class="docutils literal"><span class="pre">matplotlib.colorbar</span></tt></a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="collections_api.html"
                        title="previous chapter">collections</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="colors_api.html"
                        title="next chapter">colors</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/api/colorbar_api.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="colorbar">
<h1>colorbar<a class="headerlink" href="#colorbar" title="Permalink to this headline">¶</a></h1>
<div class="section" id="module-matplotlib.colorbar">
<span id="matplotlib-colorbar"></span><h2><a class="reference internal" href="#module-matplotlib.colorbar" title="matplotlib.colorbar"><tt class="xref py py-mod docutils literal"><span class="pre">matplotlib.colorbar</span></tt></a><a class="headerlink" href="#module-matplotlib.colorbar" title="Permalink to this headline">¶</a></h2>
<p>Colorbar toolkit with two classes and a function:</p>
<blockquote>
<div><dl class="docutils">
<dt><a class="reference internal" href="#matplotlib.colorbar.ColorbarBase" title="matplotlib.colorbar.ColorbarBase"><tt class="xref py py-class docutils literal"><span class="pre">ColorbarBase</span></tt></a></dt>
<dd>the base class with full colorbar drawing functionality.
It can be used as-is to make a colorbar for a given colormap;
a mappable object (e.g., image) is not needed.</dd>
<dt><a class="reference internal" href="#matplotlib.colorbar.Colorbar" title="matplotlib.colorbar.Colorbar"><tt class="xref py py-class docutils literal"><span class="pre">Colorbar</span></tt></a></dt>
<dd>the derived class for use with images or contour plots.</dd>
<dt><a class="reference internal" href="#matplotlib.colorbar.make_axes" title="matplotlib.colorbar.make_axes"><tt class="xref py py-func docutils literal"><span class="pre">make_axes()</span></tt></a></dt>
<dd>a function for resizing an axes and adding a second axes
suitable for a colorbar</dd>
</dl>
</div></blockquote>
<p>The <a class="reference internal" href="figure_api.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><tt class="xref py py-meth docutils literal"><span class="pre">colorbar()</span></tt></a> method uses <a class="reference internal" href="#matplotlib.colorbar.make_axes" title="matplotlib.colorbar.make_axes"><tt class="xref py py-func docutils literal"><span class="pre">make_axes()</span></tt></a>
and <a class="reference internal" href="#matplotlib.colorbar.Colorbar" title="matplotlib.colorbar.Colorbar"><tt class="xref py py-class docutils literal"><span class="pre">Colorbar</span></tt></a>; the <a class="reference internal" href="pyplot_api.html#matplotlib.pyplot.colorbar" title="matplotlib.pyplot.colorbar"><tt class="xref py py-func docutils literal"><span class="pre">colorbar()</span></tt></a> function
is a thin wrapper over <a class="reference internal" href="figure_api.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><tt class="xref py py-meth docutils literal"><span class="pre">colorbar()</span></tt></a>.</p>
<dl class="class">
<dt id="matplotlib.colorbar.Colorbar">
<em class="property">class </em><tt class="descclassname">matplotlib.colorbar.</tt><tt class="descname">Colorbar</tt><big>(</big><em>ax</em>, <em>mappable</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.Colorbar" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.colorbar.ColorbarBase" title="matplotlib.colorbar.ColorbarBase"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.colorbar.ColorbarBase</span></tt></a></p>
<p>This class connects a <a class="reference internal" href="#matplotlib.colorbar.ColorbarBase" title="matplotlib.colorbar.ColorbarBase"><tt class="xref py py-class docutils literal"><span class="pre">ColorbarBase</span></tt></a> to a
<a class="reference internal" href="cm_api.html#matplotlib.cm.ScalarMappable" title="matplotlib.cm.ScalarMappable"><tt class="xref py py-class docutils literal"><span class="pre">ScalarMappable</span></tt></a> such as a
<tt class="xref py py-class docutils literal"><span class="pre">AxesImage</span></tt> generated via
<a class="reference internal" href="axes_api.html#matplotlib.axes.Axes.imshow" title="matplotlib.axes.Axes.imshow"><tt class="xref py py-meth docutils literal"><span class="pre">imshow()</span></tt></a>.</p>
<p>It is not intended to be instantiated directly; instead,
use <a class="reference internal" href="figure_api.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><tt class="xref py py-meth docutils literal"><span class="pre">colorbar()</span></tt></a> or
<a class="reference internal" href="pyplot_api.html#matplotlib.pyplot.colorbar" title="matplotlib.pyplot.colorbar"><tt class="xref py py-func docutils literal"><span class="pre">colorbar()</span></tt></a> to make your colorbar.</p>
<dl class="method">
<dt id="matplotlib.colorbar.Colorbar.add_lines">
<tt class="descname">add_lines</tt><big>(</big><em>CS</em>, <em>erase=True</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.Colorbar.add_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the lines from a non-filled
<tt class="xref py py-class docutils literal"><span class="pre">ContourSet</span></tt> to the colorbar.</p>
<p>Set <em>erase</em> to False if these lines should be added to
any pre-existing lines.</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.Colorbar.on_mappable_changed">
<tt class="descname">on_mappable_changed</tt><big>(</big><em>mappable</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.Colorbar.on_mappable_changed" title="Permalink to this definition">¶</a></dt>
<dd><p>Updates this colorbar to match the mappable&#8217;s properties.</p>
<p>Typically this is automatically registered as an event handler
by <a class="reference internal" href="#matplotlib.colorbar.colorbar_factory" title="matplotlib.colorbar.colorbar_factory"><tt class="xref py py-func docutils literal"><span class="pre">colorbar_factory()</span></tt></a> and should not be called manually.</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.Colorbar.update_bruteforce">
<tt class="descname">update_bruteforce</tt><big>(</big><em>mappable</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.Colorbar.update_bruteforce" title="Permalink to this definition">¶</a></dt>
<dd><p>Destroy and rebuild the colorbar.  This is
intended to become obsolete, and will probably be
deprecated and then removed.  It is not called when
the pyplot.colorbar function or the Figure.colorbar
method are used to create the colorbar.</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.Colorbar.update_normal">
<tt class="descname">update_normal</tt><big>(</big><em>mappable</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.Colorbar.update_normal" title="Permalink to this definition">¶</a></dt>
<dd><p>update solid, lines, etc. Unlike update_bruteforce, it does
not clear the axes.  This is meant to be called when the image
or contour plot to which this colorbar belongs is changed.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="matplotlib.colorbar.ColorbarBase">
<em class="property">class </em><tt class="descclassname">matplotlib.colorbar.</tt><tt class="descname">ColorbarBase</tt><big>(</big><em>ax</em>, <em>cmap=None</em>, <em>norm=None</em>, <em>alpha=None</em>, <em>values=None</em>, <em>boundaries=None</em>, <em>orientation='vertical'</em>, <em>extend='neither'</em>, <em>spacing='uniform'</em>, <em>ticks=None</em>, <em>format=None</em>, <em>drawedges=False</em>, <em>filled=True</em>, <em>extendfrac=None</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="cm_api.html#matplotlib.cm.ScalarMappable" title="matplotlib.cm.ScalarMappable"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.cm.ScalarMappable</span></tt></a></p>
<p>Draw a colorbar in an existing axes.</p>
<p>This is a base class for the <a class="reference internal" href="#matplotlib.colorbar.Colorbar" title="matplotlib.colorbar.Colorbar"><tt class="xref py py-class docutils literal"><span class="pre">Colorbar</span></tt></a> class, which is the
basis for the <a class="reference internal" href="pyplot_api.html#matplotlib.pyplot.colorbar" title="matplotlib.pyplot.colorbar"><tt class="xref py py-func docutils literal"><span class="pre">colorbar()</span></tt></a> function and the
<a class="reference internal" href="figure_api.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><tt class="xref py py-meth docutils literal"><span class="pre">colorbar()</span></tt></a> method, which are the
usual ways of creating a colorbar.</p>
<p>It is also useful by itself for showing a colormap.  If the <em>cmap</em>
kwarg is given but <em>boundaries</em> and <em>values</em> are left as None,
then the colormap will be displayed on a 0-1 scale. To show the
under- and over-value colors, specify the <em>norm</em> as:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">colors</span><span class="o">.</span><span class="n">Normalize</span><span class="p">(</span><span class="n">clip</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
</pre></div>
</div>
<p>To show the colors versus index instead of on the 0-1 scale,
use:</p>
<div class="highlight-python"><pre>norm=colors.NoNorm.</pre>
</div>
<p>Useful attributes:</p>
<blockquote>
<div><dl class="docutils">
<dt><tt class="xref py py-attr docutils literal"><span class="pre">ax</span></tt></dt>
<dd>the Axes instance in which the colorbar is drawn</dd>
<dt><tt class="xref py py-attr docutils literal"><span class="pre">lines</span></tt></dt>
<dd>a list of LineCollection if lines were drawn, otherwise
an empty list</dd>
<dt><tt class="xref py py-attr docutils literal"><span class="pre">dividers</span></tt></dt>
<dd>a LineCollection if <em>drawedges</em> is True, otherwise None</dd>
</dl>
</div></blockquote>
<p>Useful public methods are <a class="reference internal" href="#matplotlib.colorbar.ColorbarBase.set_label" title="matplotlib.colorbar.ColorbarBase.set_label"><tt class="xref py py-meth docutils literal"><span class="pre">set_label()</span></tt></a> and <a class="reference internal" href="#matplotlib.colorbar.ColorbarBase.add_lines" title="matplotlib.colorbar.ColorbarBase.add_lines"><tt class="xref py py-meth docutils literal"><span class="pre">add_lines()</span></tt></a>.</p>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.add_lines">
<tt class="descname">add_lines</tt><big>(</big><em>levels</em>, <em>colors</em>, <em>linewidths</em>, <em>erase=True</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.add_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw lines on the colorbar.</p>
<p><em>colors</em> and <em>linewidths</em> must be scalars or
sequences the same length as <em>levels</em>.</p>
<p>Set <em>erase</em> to False to add lines without first
removing any previously added lines.</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.config_axis">
<tt class="descname">config_axis</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.config_axis" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.draw_all">
<tt class="descname">draw_all</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.draw_all" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate any free parameters based on the current cmap and norm,
and do all the drawing.</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.set_alpha">
<tt class="descname">set_alpha</tt><big>(</big><em>alpha</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.set_alpha" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.set_label">
<tt class="descname">set_label</tt><big>(</big><em>label</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.set_label" title="Permalink to this definition">¶</a></dt>
<dd><p>Label the long axis of the colorbar</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.set_ticklabels">
<tt class="descname">set_ticklabels</tt><big>(</big><em>ticklabels</em>, <em>update_ticks=True</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.set_ticklabels" title="Permalink to this definition">¶</a></dt>
<dd><p>set tick labels. Tick labels are updated immediately unless update_ticks is
<em>False</em>. To manually update the ticks, call <em>update_ticks</em> method explicitly.</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.set_ticks">
<tt class="descname">set_ticks</tt><big>(</big><em>ticks</em>, <em>update_ticks=True</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.set_ticks" title="Permalink to this definition">¶</a></dt>
<dd><p>set tick locations. Tick locations are updated immediately unless update_ticks is
<em>False</em>. To manually update the ticks, call <em>update_ticks</em> method explicitly.</p>
</dd></dl>

<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.update_ticks">
<tt class="descname">update_ticks</tt><big>(</big><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.update_ticks" title="Permalink to this definition">¶</a></dt>
<dd><p>Force the update of the ticks and ticklabels. This must be
called whenever the tick locator and/or tick formatter changes.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="matplotlib.colorbar.ColorbarPatch">
<em class="property">class </em><tt class="descclassname">matplotlib.colorbar.</tt><tt class="descname">ColorbarPatch</tt><big>(</big><em>ax</em>, <em>mappable</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.ColorbarPatch" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.colorbar.Colorbar" title="matplotlib.colorbar.Colorbar"><tt class="xref py py-class docutils literal"><span class="pre">matplotlib.colorbar.Colorbar</span></tt></a></p>
<p>A Colorbar which is created using <a class="reference internal" href="artist_api.html#matplotlib.patches.Patch" title="matplotlib.patches.Patch"><tt class="xref py py-class docutils literal"><span class="pre">Patch</span></tt></a>
rather than the default <tt class="xref py py-func docutils literal"><span class="pre">pcolor()</span></tt>.</p>
<p>It uses a list of Patch instances instead of a
<a class="reference internal" href="collections_api.html#matplotlib.collections.PatchCollection" title="matplotlib.collections.PatchCollection"><tt class="xref py py-class docutils literal"><span class="pre">PatchCollection</span></tt></a> because the
latter does not allow the hatch pattern to vary among the
members of the collection.</p>
</dd></dl>

<dl class="function">
<dt id="matplotlib.colorbar.colorbar_factory">
<tt class="descclassname">matplotlib.colorbar.</tt><tt class="descname">colorbar_factory</tt><big>(</big><em>cax</em>, <em>mappable</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.colorbar_factory" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a colorbar on the given axes for the given mappable.</p>
<p>Typically, for automatic colorbar placement given only a mappable use
<a class="reference internal" href="figure_api.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><tt class="xref py py-meth docutils literal"><span class="pre">colorbar()</span></tt></a>.</p>
</dd></dl>

<dl class="function">
<dt id="matplotlib.colorbar.make_axes">
<tt class="descclassname">matplotlib.colorbar.</tt><tt class="descname">make_axes</tt><big>(</big><em>parent</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.make_axes" title="Permalink to this definition">¶</a></dt>
<dd><p>Resize and reposition a parent axes, and return a child
axes suitable for a colorbar:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">cax</span><span class="p">,</span> <span class="n">kw</span> <span class="o">=</span> <span class="n">make_axes</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
</pre></div>
</div>
<p>Keyword arguments may include the following (with defaults):</p>
<blockquote>
<div><dl class="docutils">
<dt><em>orientation</em></dt>
<dd>&#8216;vertical&#8217;  or &#8216;horizontal&#8217;</dd>
</dl>
</div></blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Property</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><em>orientation</em></td>
<td>vertical or horizontal</td>
</tr>
<tr class="row-odd"><td><em>fraction</em></td>
<td>0.15; fraction of original axes to use for colorbar</td>
</tr>
<tr class="row-even"><td><em>pad</em></td>
<td>0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and new image axes</td>
</tr>
<tr class="row-odd"><td><em>shrink</em></td>
<td>1.0; fraction by which to shrink the colorbar</td>
</tr>
<tr class="row-even"><td><em>aspect</em></td>
<td>20; ratio of long to short dimensions</td>
</tr>
<tr class="row-odd"><td><em>anchor</em></td>
<td>(0.0, 0.5) if vertical; (0.5, 1.0) if horizontal;
the anchor point of the colorbar axes</td>
</tr>
<tr class="row-even"><td><em>panchor</em></td>
<td>(1.0, 0.5) if vertical; (0.5, 0.0) if horizontal;
the anchor point of the colorbar parent axes</td>
</tr>
</tbody>
</table>
<p>All but the first of these are stripped from the input kw set.</p>
<p>Returns (cax, kw), the child axes and the reduced kw dictionary.</p>
</dd></dl>

<dl class="function">
<dt id="matplotlib.colorbar.make_axes_gridspec">
<tt class="descclassname">matplotlib.colorbar.</tt><tt class="descname">make_axes_gridspec</tt><big>(</big><em>parent</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#matplotlib.colorbar.make_axes_gridspec" title="Permalink to this definition">¶</a></dt>
<dd><p>Resize and reposition a parent axes, and return a child axes
suitable for a colorbar. This function is similar to
make_axes. Prmary differences are</p>
<blockquote>
<div><ul>
<li><p class="first"><em>make_axes_gridspec</em> should only be used with a subplot parent.</p>
</li>
<li><dl class="first docutils">
<dt><em>make_axes</em> creates an instance of Axes. <em>make_axes_gridspec</em></dt>
<dd><p class="first last">creates an instance of Subplot.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><em>make_axes</em> updates the position of the</dt>
<dd><p class="first last">parent. <em>make_axes_gridspec</em> replaces the grid_spec attribute
of the parent with a new one.</p>
</dd>
</dl>
</li>
</ul>
</div></blockquote>
<p>While this function is meant to be compatible with <em>make_axes</em>,
there could be some minor differences.:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">cax</span><span class="p">,</span> <span class="n">kw</span> <span class="o">=</span> <span class="n">make_axes_gridspec</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
</pre></div>
</div>
<p>Keyword arguments may include the following (with defaults):</p>
<blockquote>
<div><dl class="docutils">
<dt><em>orientation</em></dt>
<dd>&#8216;vertical&#8217;  or &#8216;horizontal&#8217;</dd>
</dl>
</div></blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="20%" />
<col width="80%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Property</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><em>orientation</em></td>
<td>vertical or horizontal</td>
</tr>
<tr class="row-odd"><td><em>fraction</em></td>
<td>0.15; fraction of original axes to use for colorbar</td>
</tr>
<tr class="row-even"><td><em>pad</em></td>
<td>0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and new image axes</td>
</tr>
<tr class="row-odd"><td><em>shrink</em></td>
<td>1.0; fraction by which to shrink the colorbar</td>
</tr>
<tr class="row-even"><td><em>aspect</em></td>
<td>20; ratio of long to short dimensions</td>
</tr>
<tr class="row-odd"><td><em>anchor</em></td>
<td>(0.0, 0.5) if vertical; (0.5, 1.0) if horizontal;
the anchor point of the colorbar axes</td>
</tr>
<tr class="row-even"><td><em>panchor</em></td>
<td>(1.0, 0.5) if vertical; (0.5, 0.0) if horizontal;
the anchor point of the colorbar parent axes</td>
</tr>
</tbody>
</table>
<p>All but the first of these are stripped from the input kw set.</p>
<p>Returns (cax, kw), the child axes and the reduced kw dictionary.</p>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="colors_api.html" title="colors"
             >next</a> |</li>
        <li class="right" >
          <a href="collections_api.html" title="collections"
             >previous</a> |</li>
        <li><a href="../index.html">home</a>|&nbsp;</li>
        <li><a href="../search.html">search</a>|&nbsp;</li>
        <li><a href="../examples/index.html">examples</a>|&nbsp;</li>
        <li><a href="../gallery.html">gallery</a>|&nbsp;</li>
        <li><a href="../contents.html">docs</a> &raquo;</li>

          <li><a href="index.html" >The Matplotlib API</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the matplotlib development team.
      Last updated on Jul 23, 2013.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>