You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<divid="unreleased-message"> You are reading an old version of the documentation (v1.4.0). For the latest version see <ahref="https://matplotlib.org/stable/api/cbook_api.html">https://matplotlib.org/stable/api/cbook_api.html</a></div>
<h1>cbook<aclass="headerlink" href="#cbook" title="Permalink to this headline">¶</a></h1>
<divclass="section" id="module-matplotlib.cbook">
<spanid="matplotlib-cbook"></span><h2><aclass="reference internal" href="#module-matplotlib.cbook" title="matplotlib.cbook"><ttclass="xref py py-mod docutils literal"><spanclass="pre">matplotlib.cbook</span></tt></a><aclass="headerlink" href="#module-matplotlib.cbook" title="Permalink to this headline">¶</a></h2>
<p>A collection of utility functions and classes. Originally, many
(but not all) were from the Python Cookbook – hence the name cbook.</p>
<p>This module is safe to import from anywhere within matplotlib;
it imports matplotlib only at runtime.</p>
<dlclass="class">
<dtid="matplotlib.cbook.Bunch">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">Bunch</tt><spanclass="sig-paren">(</span><em>**kwds</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Bunch" title="Permalink to this definition">¶</a></dt>
<dd><p>Often we want to just collect a bunch of stuff together, naming each
item of the bunch; a dictionary’s OK for that, but a small do- nothing
class is even handier, and prettier to use. Whenever you want to
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">CallbackRegistry</tt><spanclass="sig-paren">(</span><em>*args</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.CallbackRegistry" title="Permalink to this definition">¶</a></dt>
<dd><p>Handle registering and disconnecting for a set of signals and
<spanclass="gp">>>> </span><spanclass="n">callbacks</span><spanclass="o">.</span><spanclass="n">process</span><spanclass="p">(</span><spanclass="s">'be merry'</span><spanclass="p">,</span><spanclass="mi">456</span><spanclass="p">)</span><spanclass="c"># nothing will be called</span>
<spanclass="gp">>>> </span><spanclass="n">callbacks</span><spanclass="o">.</span><spanclass="n">process</span><spanclass="p">(</span><spanclass="s">'eat'</span><spanclass="p">,</span><spanclass="mi">456</span><spanclass="p">)</span><spanclass="c"># nothing will be called</span>
</pre></div>
</div>
<p>In practice, one should always disconnect all callbacks when they
are no longer needed to avoid dangling references (and thus memory
leaks). However, real code in matplotlib rarely does so, and due
to its design, it is rather difficult to place this kind of code.
To get around this, and prevent this class of memory leaks, we
instead store weak references to bound methods only, so when the
destination object needs to die, the CallbackRegistry won’t keep
it alive. The Python stdlib weakref module can not create weak
references to bound methods directly, so we need to create a proxy
object to handle weak references to bound methods (or regular free
functions). This technique was shared by Peter Parente on his
<ttclass="descname">connect</tt><spanclass="sig-paren">(</span><em>s</em>, <em>func</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.CallbackRegistry.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>register <em>func</em> to be called when a signal <em>s</em> is generated
<ttclass="descname">disconnect</tt><spanclass="sig-paren">(</span><em>cid</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.CallbackRegistry.disconnect" title="Permalink to this definition">¶</a></dt>
<dd><p>disconnect the callback registered with callback id <em>cid</em></p>
<ttclass="descname">process</tt><spanclass="sig-paren">(</span><em>s</em>, <em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.CallbackRegistry.process" title="Permalink to this definition">¶</a></dt>
<dd><p>process signal <em>s</em>. All of the functions registered to receive
callbacks on <em>s</em> will be called with <em>*args</em> and <em>**kwargs</em></p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.GetRealpathAndStat">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">GetRealpathAndStat</tt><aclass="headerlink" href="#matplotlib.cbook.GetRealpathAndStat" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.Grouper">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">Grouper</tt><spanclass="sig-paren">(</span><em>init=[]</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Grouper" title="Permalink to this definition">¶</a></dt>
<p>This class provides a lightweight way to group arbitrary objects
together into disjoint sets when a full-blown graph data structure
would be overkill.</p>
<p>Objects can be joined using <aclass="reference internal" href="#matplotlib.cbook.Grouper.join" title="matplotlib.cbook.Grouper.join"><ttclass="xref py py-meth docutils literal"><spanclass="pre">join()</span></tt></a>, tested for connectedness
using <aclass="reference internal" href="#matplotlib.cbook.Grouper.joined" title="matplotlib.cbook.Grouper.joined"><ttclass="xref py py-meth docutils literal"><spanclass="pre">joined()</span></tt></a>, and all disjoint sets can be retreived by
using the object as an iterator.</p>
<p>The objects being joined must be hashable and weak-referenceable.</p>
<ttclass="descname">clean</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Grouper.clean" title="Permalink to this definition">¶</a></dt>
<dd><p>Clean dead weak references from the dictionary</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Grouper.get_siblings">
<ttclass="descname">get_siblings</tt><spanclass="sig-paren">(</span><em>a</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Grouper.get_siblings" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns all of the items joined with <em>a</em>, including itself.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Grouper.join">
<ttclass="descname">join</tt><spanclass="sig-paren">(</span><em>a</em>, <em>*args</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Grouper.join" title="Permalink to this definition">¶</a></dt>
<dd><p>Join given arguments into the same set. Accepts one or more
arguments.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Grouper.joined">
<ttclass="descname">joined</tt><spanclass="sig-paren">(</span><em>a</em>, <em>b</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Grouper.joined" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if <em>a</em> and <em>b</em> are members of the same set.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.Idle">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">Idle</tt><spanclass="sig-paren">(</span><em>func</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Idle" title="Permalink to this definition">¶</a></dt>
<ttclass="descname">run</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Idle.run" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="attribute">
<dtid="matplotlib.cbook.Idle.waittime">
<ttclass="descname">waittime</tt><emclass="property"> = 0.05</em><aclass="headerlink" href="#matplotlib.cbook.Idle.waittime" title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">MatplotlibDeprecationWarning</tt><aclass="headerlink" href="#matplotlib.cbook.MatplotlibDeprecationWarning" title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">MemoryMonitor</tt><spanclass="sig-paren">(</span><em>nmax=20000</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.MemoryMonitor" title="Permalink to this definition">¶</a></dt>
<dd><dlclass="method">
<dtid="matplotlib.cbook.MemoryMonitor.clear">
<ttclass="descname">clear</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.MemoryMonitor.clear" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.MemoryMonitor.plot">
<ttclass="descname">plot</tt><spanclass="sig-paren">(</span><em>i0=0</em>, <em>isub=1</em>, <em>fig=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.MemoryMonitor.plot" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.MemoryMonitor.report">
<ttclass="descname">report</tt><spanclass="sig-paren">(</span><em>segments=4</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.MemoryMonitor.report" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.MemoryMonitor.xy">
<ttclass="descname">xy</tt><spanclass="sig-paren">(</span><em>i0=0</em>, <em>isub=1</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.MemoryMonitor.xy" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.Null">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">Null</tt><spanclass="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Null" title="Permalink to this definition">¶</a></dt>
<dd><p>Null objects always and reliably “do nothing.”</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.RingBuffer">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">RingBuffer</tt><spanclass="sig-paren">(</span><em>size_max</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.RingBuffer" title="Permalink to this definition">¶</a></dt>
<dd><p>class that implements a not-yet-full buffer</p>
<dlclass="method">
<dtid="matplotlib.cbook.RingBuffer.append">
<ttclass="descname">append</tt><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.RingBuffer.append" title="Permalink to this definition">¶</a></dt>
<dd><p>append an element at the end of the buffer</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.RingBuffer.get">
<ttclass="descname">get</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.RingBuffer.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of elements from the oldest to the newest.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.Scheduler">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">Scheduler</tt><aclass="headerlink" href="#matplotlib.cbook.Scheduler" title="Permalink to this definition">¶</a></dt>
<ttclass="descname">id</tt><emclass="property"> = 0</em><aclass="headerlink" href="#matplotlib.cbook.Scheduler.id" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="attribute">
<dtid="matplotlib.cbook.Scheduler.idlelock">
<ttclass="descname">idlelock</tt><emclass="property"> = <thread.lock object at 0x7f1780f1c490></em><aclass="headerlink" href="#matplotlib.cbook.Scheduler.idlelock" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Scheduler.stop">
<ttclass="descname">stop</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Scheduler.stop" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.Sorter">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">Sorter</tt><aclass="headerlink" href="#matplotlib.cbook.Sorter" title="Permalink to this definition">¶</a></dt>
<spanclass="n">sort</span><spanclass="p">(</span><spanclass="nb">list</span><spanclass="p">,</span><spanclass="mi">1</span><spanclass="p">)</span><spanclass="c"># sort by index 1</span>
<spanclass="n">sort</span><spanclass="p">(</span><spanclass="nb">dict</span><spanclass="p">,</span><spanclass="s">'a'</span><spanclass="p">)</span><spanclass="c"># sort a list of dicts by key 'a'</span>
</pre></div>
</div>
<dlclass="method">
<dtid="matplotlib.cbook.Sorter.byAttribute">
<ttclass="descname">byAttribute</tt><spanclass="sig-paren">(</span><em>data</em>, <em>attributename</em>, <em>inplace=1</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Sorter.byAttribute" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Sorter.byItem">
<ttclass="descname">byItem</tt><spanclass="sig-paren">(</span><em>data</em>, <em>itemindex=None</em>, <em>inplace=1</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Sorter.byItem" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Sorter.sort">
<ttclass="descname">sort</tt><spanclass="sig-paren">(</span><em>data</em>, <em>itemindex=None</em>, <em>inplace=1</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Sorter.sort" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.Stack">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">Stack</tt><spanclass="sig-paren">(</span><em>default=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Stack" title="Permalink to this definition">¶</a></dt>
<p>Implement a stack where elements can be pushed on and you can move
back and forth. But no pop. Should mimic home / back / forward
in a browser</p>
<dlclass="method">
<dtid="matplotlib.cbook.Stack.back">
<ttclass="descname">back</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Stack.back" title="Permalink to this definition">¶</a></dt>
<dd><p>move the position back and return the current element</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Stack.bubble">
<ttclass="descname">bubble</tt><spanclass="sig-paren">(</span><em>o</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Stack.bubble" title="Permalink to this definition">¶</a></dt>
<dd><p>raise <em>o</em> to the top of the stack and return <em>o</em>. <em>o</em> must be
in the stack</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Stack.clear">
<ttclass="descname">clear</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Stack.clear" title="Permalink to this definition">¶</a></dt>
<dd><p>empty the stack</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Stack.empty">
<ttclass="descname">empty</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Stack.empty" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Stack.forward">
<ttclass="descname">forward</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Stack.forward" title="Permalink to this definition">¶</a></dt>
<dd><p>move the position forward and return the current element</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Stack.home">
<ttclass="descname">home</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Stack.home" title="Permalink to this definition">¶</a></dt>
<dd><p>push the first element onto the top of the stack</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Stack.push">
<ttclass="descname">push</tt><spanclass="sig-paren">(</span><em>o</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Stack.push" title="Permalink to this definition">¶</a></dt>
<dd><p>push object onto stack at current position - all elements
occurring later than the current position are discarded</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.cbook.Stack.remove">
<ttclass="descname">remove</tt><spanclass="sig-paren">(</span><em>o</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Stack.remove" title="Permalink to this definition">¶</a></dt>
<dd><p>remove element <em>o</em> from the stack</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.Timeout">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">Timeout</tt><spanclass="sig-paren">(</span><em>wait</em>, <em>func</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Timeout" title="Permalink to this definition">¶</a></dt>
<p>Schedule recurring events with a wait time in seconds</p>
<dlclass="method">
<dtid="matplotlib.cbook.Timeout.run">
<ttclass="descname">run</tt><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Timeout.run" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.Xlator">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">Xlator</tt><aclass="headerlink" href="#matplotlib.cbook.Xlator" title="Permalink to this definition">¶</a></dt>
<divclass="highlight-python"><divclass="highlight"><pre><spanclass="n">text</span><spanclass="o">=</span><spanclass="s">"Larry Wall is the creator of Perl"</span>
<ttclass="descname">xlat</tt><spanclass="sig-paren">(</span><em>text</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.Xlator.xlat" title="Permalink to this definition">¶</a></dt>
<dd><p>Translate <em>text</em>, returns the modified text.</p>
</dd></dl>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.align_iterators">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">align_iterators</tt><spanclass="sig-paren">(</span><em>func</em>, <em>*iterables</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.align_iterators" title="Permalink to this definition">¶</a></dt>
<dd><p>This generator takes a bunch of iterables that are ordered by func
It sends out ordered tuples:</p>
<divclass="highlight-python"><divclass="highlight"><pre>(func(row), [rows from all iterators matching func(row)])
</pre></div>
</div>
<p>It is used by <aclass="reference internal" href="mlab_api.html#matplotlib.mlab.recs_join" title="matplotlib.mlab.recs_join"><ttclass="xref py py-func docutils literal"><spanclass="pre">matplotlib.mlab.recs_join()</span></tt></a> to join record arrays</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.allequal">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">allequal</tt><spanclass="sig-paren">(</span><em>seq</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.allequal" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <em>True</em> if all elements of <em>seq</em> compare equal. If <em>seq</em> is
0 or 1 length, return <em>True</em></p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.allpairs">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">allpairs</tt><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.allpairs" title="Permalink to this definition">¶</a></dt>
<dd><p>return all possible pairs in sequence <em>x</em></p>
<p>Condensed by Alex Martelli from this <aclass="reference external" href="http://groups.google.com/groups?q=all+pairs+group:*python*&hl=en&lr=&ie=UTF-8&selm=mailman.4028.1096403649.5135.python-list%40python.org&rnum=1">thread</a> on c.l.python</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.alltrue">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">alltrue</tt><spanclass="sig-paren">(</span><em>seq</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.alltrue" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <em>True</em> if all elements of <em>seq</em> evaluate to <em>True</em>. If
<em>seq</em> is empty, return <em>False</em>.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.boxplot_stats">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">boxplot_stats</tt><spanclass="sig-paren">(</span><em>X</em>, <em>whis=1.5</em>, <em>bootstrap=None</em>, <em>labels=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.boxplot_stats" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div>Returns list of dictionaries of staticists to be use to draw a series of
box and whisker plots. See the <ttclass="xref py py-obj docutils literal"><spanclass="pre">Returns</span></tt> section below to the required
keys of the dictionary. Users can skip this function and pass a user-
defined set of dictionaries to the new <ttclass="xref py py-obj docutils literal"><spanclass="pre">axes.bxp</span></tt> method instead of
relying on MPL to do the calcs.</div></blockquote>
<dd><pclass="first last">Labels for each dataset. Length must be compatible with dimensions
of <ttclass="xref py py-obj docutils literal"><spanclass="pre">X</span></tt></p>
</dd>
</dl>
</div></blockquote>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first"><strong>bxpstats</strong> : list of dict</p>
<blockquoteclass="last">
<div><p>A list of dictionaries containing the results for each column
of data. Keys of each dictionary are the following:</p>
<tableborder="1" class="docutils">
<colgroup>
<colwidth="19%" />
<colwidth="81%" />
</colgroup>
<theadvalign="bottom">
<trclass="row-odd"><thclass="head">Key</th>
<thclass="head">Value Description</th>
</tr>
</thead>
<tbodyvalign="top">
<trclass="row-even"><td>label</td>
<td>tick label for the boxplot</td>
</tr>
<trclass="row-odd"><td>mean</td>
<td>arithemetic mean value</td>
</tr>
<trclass="row-even"><td>median</td>
<td>50th percentile</td>
</tr>
<trclass="row-odd"><td>q1</td>
<td>first quartile (25th percentile)</td>
</tr>
<trclass="row-even"><td>q3</td>
<td>third quartile (75th percentile)</td>
</tr>
<trclass="row-odd"><td>cilo</td>
<td>lower notch around the median</td>
</tr>
<trclass="row-even"><td>ciho</td>
<td>upper notch around the median</td>
</tr>
<trclass="row-odd"><td>whislo</td>
<td>end of the lower whisker</td>
</tr>
<trclass="row-even"><td>whishi</td>
<td>end of the upper whisker</td>
</tr>
<trclass="row-odd"><td>fliers</td>
<td>outliers</td>
</tr>
</tbody>
</table>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p>rac{mathrm{iqr}}{sqrt{N}}</p>
<blockquote>
<div><p>General approach from:
McGill, R., Tukey, J.W., and Larsen, W.A. (1978) “Variations of</p>
<blockquote>
<div>Boxplots”, The American Statistician, 32:12-16.</div></blockquote>
</div></blockquote>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.converter">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">converter</tt><spanclass="sig-paren">(</span><em>missing=u'Null'</em>, <em>missingval=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.converter" title="Permalink to this definition">¶</a></dt>
<p>Base class for handling string -> python type with support for
missing values</p>
<dlclass="method">
<dtid="matplotlib.cbook.converter.is_missing">
<ttclass="descname">is_missing</tt><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.converter.is_missing" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.dedent">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">dedent</tt><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.dedent" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove excess indentation from docstring <em>s</em>.</p>
<p>Discards any leading blank lines, then removes up to n whitespace
characters from each line, where n is the number of leading
whitespace characters in the first line. It differs from
textwrap.dedent in its deletion of leading blank lines and its use
of the first non-blank line to determine the indentation.</p>
<p>It is also faster in most cases.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.delete_masked_points">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">delete_masked_points</tt><spanclass="sig-paren">(</span><em>*args</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.delete_masked_points" title="Permalink to this definition">¶</a></dt>
<dd><p>Find all masked and/or non-finite points in a set of arguments,
and return the arguments with only the unmasked points remaining.</p>
<p>Arguments can be in any of 5 categories:</p>
<olclass="arabic simple">
<li>1-D masked arrays</li>
<li>1-D ndarrays</li>
<li>ndarrays with more than one dimension</li>
<li>other non-string iterables</li>
<li>anything else</li>
</ol>
<p>The first argument must be in one of the first four categories;
any argument with a length differing from that of the first
argument (and hence anything in category 5) then will be
passed through unchanged.</p>
<p>Masks are obtained from all arguments of the correct length
in categories 1, 2, and 4; a point is bad if masked in a masked
array or if it is a nan or inf. No attempt is made to
extract a mask from categories 2, 3, and 4 if <ttclass="xref py py-meth docutils literal"><spanclass="pre">np.isfinite()</span></tt>
does not yield a Boolean array.</p>
<p>All input arguments that are not passed unchanged are returned
as ndarrays after removing the points or rows corresponding to
masks in any of the arguments.</p>
<p>A vastly simpler version of this function was originally
written as a helper for Axes.scatter().</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.deprecated">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">deprecated</tt><spanclass="sig-paren">(</span><em>since</em>, <em>message=u''</em>, <em>name=u''</em>, <em>alternative=u''</em>, <em>pending=False</em>, <em>obj_type=u'function'</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.deprecated" title="Permalink to this definition">¶</a></dt>
<dd><p>Decorator to mark a function as deprecated.</p>
<div><p>An alternative function that the user may use in place of the
deprecated function. The deprecation warning will tell the user about
this alternative if provided.</p>
</div></blockquote>
<p><strong>pending</strong> : bool, optional</p>
<blockquoteclass="last">
<div><p>If True, uses a PendingDeprecationWarning instead of a
DeprecationWarning.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<pclass="rubric">Examples</p>
<p>@deprecated(‘1.4.0’)
def the_function_to_deprecate():</p>
<blockquote>
<div>pass</div></blockquote>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.dict_delall">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">dict_delall</tt><spanclass="sig-paren">(</span><em>d</em>, <em>keys</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.dict_delall" title="Permalink to this definition">¶</a></dt>
<dd><p>delete all of the <em>keys</em> from the <ttclass="xref py py-class docutils literal"><spanclass="pre">dict</span></tt><em>d</em></p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.exception_to_str">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">exception_to_str</tt><spanclass="sig-paren">(</span><em>s=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.exception_to_str" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.file_requires_unicode">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">file_requires_unicode</tt><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.file_requires_unicode" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <ttclass="xref py py-obj docutils literal"><spanclass="pre">True</span></tt> if the given writable file-like object requires Unicode
to be written to it.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.finddir">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">finddir</tt><spanclass="sig-paren">(</span><em>o</em>, <em>match</em>, <em>case=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.finddir" title="Permalink to this definition">¶</a></dt>
<dd><p>return all attributes of <em>o</em> which match string in match. if case
is True require an exact case match.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.flatten">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">flatten</tt><spanclass="sig-paren">(</span><em>seq</em>, <em>scalarp=<function is_scalar_or_string at 0x7f177d6b76e0></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.flatten" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a generator of flattened nested containers</p>
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">get_recursive_filelist</tt><spanclass="sig-paren">(</span><em>args</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.get_recursive_filelist" title="Permalink to this definition">¶</a></dt>
<dd><p>Recurse all the files and dirs in <em>args</em> ignoring symbolic links
and return the files as a list of strings</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.get_sample_data">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">get_sample_data</tt><spanclass="sig-paren">(</span><em>fname</em>, <em>asfileobj=True</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.get_sample_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a sample data file. <em>fname</em> is a path relative to the
<ttclass="xref py py-obj docutils literal"><spanclass="pre">mpl-data/sample_data</span></tt> directory. If <em>asfileobj</em> is <ttclass="xref py py-obj docutils literal"><spanclass="pre">True</span></tt>
return a file object, otherwise just a file path.</p>
<p>Set the rc parameter examples.directory to the directory where we should
look, if sample_data files are stored in a location different than
default (which is ‘mpl-data/sample_data` at the same level of ‘matplotlib`
Python module files).</p>
<p>If the filename ends in .gz, the file is implicitly ungzipped.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.get_split_ind">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">get_split_ind</tt><spanclass="sig-paren">(</span><em>seq</em>, <em>N</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.get_split_ind" title="Permalink to this definition">¶</a></dt>
<dd><p><em>seq</em> is a list of words. Return the index into seq such that:</p>
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">is_math_text</tt><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.is_math_text" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.is_numlike">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">is_numlike</tt><spanclass="sig-paren">(</span><em>obj</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.is_numlike" title="Permalink to this definition">¶</a></dt>
<dd><p>return true if <em>obj</em> looks like a number</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.is_scalar">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">is_scalar</tt><spanclass="sig-paren">(</span><em>obj</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.is_scalar" title="Permalink to this definition">¶</a></dt>
<dd><p>return true if <em>obj</em> is not string like and is not iterable</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.is_scalar_or_string">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">is_scalar_or_string</tt><spanclass="sig-paren">(</span><em>val</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.is_scalar_or_string" title="Permalink to this definition">¶</a></dt>
<dd><p>Return whether the given object is a scalar or string like.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.is_sequence_of_strings">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">is_sequence_of_strings</tt><spanclass="sig-paren">(</span><em>obj</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.is_sequence_of_strings" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns true if <em>obj</em> is iterable and contains strings</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.is_string_like">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">is_string_like</tt><spanclass="sig-paren">(</span><em>obj</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.is_string_like" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if <em>obj</em> looks like a string</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.is_writable_file_like">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">is_writable_file_like</tt><spanclass="sig-paren">(</span><em>obj</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.is_writable_file_like" title="Permalink to this definition">¶</a></dt>
<dd><p>return true if <em>obj</em> looks like a file object with a <em>write</em> method</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.issubclass_safe">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">issubclass_safe</tt><spanclass="sig-paren">(</span><em>x</em>, <em>klass</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.issubclass_safe" title="Permalink to this definition">¶</a></dt>
<dd><p>return issubclass(x, klass) and return False on a TypeError</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.iterable">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">iterable</tt><spanclass="sig-paren">(</span><em>obj</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.iterable" title="Permalink to this definition">¶</a></dt>
<dd><p>return true if <em>obj</em> is iterable</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.listFiles">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">listFiles</tt><spanclass="sig-paren">(</span><em>root</em>, <em>patterns=u'*'</em>, <em>recurse=1</em>, <em>return_folders=0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.listFiles" title="Permalink to this definition">¶</a></dt>
<dd><p>Recursively list files</p>
<p>from Parmar and Martelli in the Python Cookbook</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.maxdict">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">maxdict</tt><spanclass="sig-paren">(</span><em>maxsize</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.maxdict" title="Permalink to this definition">¶</a></dt>
<p>A dictionary with a maximum size; this doesn’t override all the
relevant methods to contrain size, just setitem, so use with
caution</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.mkdirs">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">mkdirs</tt><spanclass="sig-paren">(</span><em>newdir</em>, <em>mode=511</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.mkdirs" title="Permalink to this definition">¶</a></dt>
<dd><p>make directory <em>newdir</em> recursively, and set <em>mode</em>. Equivalent to</p>
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">mplDeprecation</tt><aclass="headerlink" href="#matplotlib.cbook.mplDeprecation" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <aclass="reference internal" href="#matplotlib.cbook.MatplotlibDeprecationWarning" title="matplotlib.cbook.MatplotlibDeprecationWarning"><ttclass="xref py py-class docutils literal"><spanclass="pre">MatplotlibDeprecationWarning</span></tt></a></p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.onetrue">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">onetrue</tt><spanclass="sig-paren">(</span><em>seq</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.onetrue" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <em>True</em> if one element of <em>seq</em> is <em>True</em>. It <em>seq</em> is
empty, return <em>False</em>.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.pieces">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">pieces</tt><spanclass="sig-paren">(</span><em>seq</em>, <em>num=2</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.pieces" title="Permalink to this definition">¶</a></dt>
<dd><p>Break up the <em>seq</em> into <em>num</em> tuples</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.popall">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">popall</tt><spanclass="sig-paren">(</span><em>seq</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.popall" title="Permalink to this definition">¶</a></dt>
<dd><p>empty a list</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.print_cycles">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">print_cycles</tt><spanclass="sig-paren">(</span><em>objects</em>, <em>outstream=<open file '<stdout>'</em>, <em>mode 'w' at 0x7f1787a5d150></em>, <em>show_progress=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.print_cycles" title="Permalink to this definition">¶</a></dt>
<dd><dlclass="docutils">
<dt><em>objects</em></dt>
<dd>A list of objects to find cycles in. It is often useful to
pass in gc.garbage to find the cycles that are preventing some
objects from being garbage collected.</dd>
<dt><em>outstream</em></dt>
<dd>The stream for output.</dd>
<dt><em>show_progress</em></dt>
<dd>If True, print the number of objects reached as they are found.</dd>
</dl>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.recursive_remove">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">recursive_remove</tt><spanclass="sig-paren">(</span><em>path</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.recursive_remove" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.report_memory">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">report_memory</tt><spanclass="sig-paren">(</span><em>i=0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.report_memory" title="Permalink to this definition">¶</a></dt>
<dd><p>return the memory consumed by process</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.restrict_dict">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">restrict_dict</tt><spanclass="sig-paren">(</span><em>d</em>, <em>keys</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.restrict_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a dictionary that contains those keys that appear in both
d and keys, with values from d.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.reverse_dict">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">reverse_dict</tt><spanclass="sig-paren">(</span><em>d</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.reverse_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>reverse the dictionary – may lose data if values are not unique!</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.safe_masked_invalid">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">safe_masked_invalid</tt><spanclass="sig-paren">(</span><em>x</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.safe_masked_invalid" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="function">
<dtid="matplotlib.cbook.safezip">
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">safezip</tt><spanclass="sig-paren">(</span><em>*args</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.safezip" title="Permalink to this definition">¶</a></dt>
<dd><p>make sure <em>args</em> are equal len before zipping</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.cbook.silent_list">
<emclass="property">class </em><ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">silent_list</tt><spanclass="sig-paren">(</span><em>type</em>, <em>seq=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.silent_list" title="Permalink to this definition">¶</a></dt>
<ttclass="descclassname">matplotlib.cbook.</tt><ttclass="descname">simple_linear_interpolation</tt><spanclass="sig-paren">(</span><em>a</em>, <em>steps</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.cbook.simple_linear_interpolation" title="Permalink to this definition">¶</a></dt>