def format_deltas(key, dx, dy):<EOL><INDENT>if key=='<STR_LIT>':<EOL><INDENT>if(abs(dx)>abs(dy)):<EOL><INDENT>dy = dx<EOL><DEDENT>else:<EOL><INDENT>dx = dy<EOL><DEDENT><DEDENT>elif key=='<STR_LIT:x>':<EOL><INDENT>dy = <NUM_LIT:0><EOL><DEDENT>elif key=='<STR_LIT:y>':<EOL><INDENT>dx = <NUM_LIT:0><EOL><DEDENT>elif key=='<STR_LIT>':<EOL><INDENT>if <NUM_LIT:2>*abs(dx) < abs(dy):<EOL><INDENT>dx=<NUM_LIT:0><EOL><DEDENT>elif <NUM_LIT:2>*abs(dy) < abs(dx):<EOL><INDENT>dy=<NUM_LIT:0><EOL><DEDENT>elif(abs(dx)>abs(dy)):<EOL><INDENT>dy=dy/abs(dy)*abs(dx)<EOL><DEDENT>else:<EOL><INDENT>dx=dx/abs(dx)*abs(dy)<EOL><DEDENT><DEDENT>return (dx,dy)<EOL><DEDENT>p = self._pan_start<EOL>dx = x - p.x<EOL>dy = y - p.y<EOL>if dx == <NUM_LIT:0> and dy == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>if button == <NUM_LIT:1>:<EOL><INDENT>dx, dy = format_deltas(key, dx, dy)<EOL>result = p.bbox.translated(-dx, -dy).transformed(p.trans_inverse)<EOL><DEDENT>elif button == <NUM_LIT:3>:<EOL><INDENT>try:<EOL><INDENT>dx = -dx / float(self.bbox.width)<EOL>dy = -dy / float(self.bbox.height)<EOL>dx, dy = format_deltas(key, dx, dy)<EOL>if self.get_aspect() != '<STR_LIT>':<EOL><INDENT>dx = <NUM_LIT:0.5> * (dx + dy)<EOL>dy = dx<EOL><DEDENT>alpha = np.power(<NUM_LIT>, (dx, dy))<EOL>start = p.trans_inverse.transform_point((p.x, p.y))<EOL>lim_points = p.lim.get_points()<EOL>result = start + alpha * (lim_points - start)<EOL>result = mtransforms.Bbox(result)<EOL><DEDENT>except OverflowError:<EOL><INDENT>warnings.warn('<STR_LIT>')<EOL>return<EOL><DEDENT><DEDENT>self.set_xlim(*result.intervalx)<EOL>self.set_ylim(*result.intervaly)<EOL>

Called when the mouse moves during a pan operation.

*button* is the mouse button number:

* 1: LEFT
* 2: MIDDLE
* 3: RIGHT

*key* is a "shift" key

*x*, *y* are the mouse coordinates in display coords.

.. note::
    Intended to be overridden by new projection types.


return self._cursorProps<EOL>

return the cursor propertiess as a (*linewidth*, *color*)
tuple, where *linewidth* is a float and *color* is an RGBA
tuple


if len(args)==<NUM_LIT:1>:<EOL><INDENT>lw, c = args[<NUM_LIT:0>]<EOL><DEDENT>elif len(args)==<NUM_LIT:2>:<EOL><INDENT>lw, c = args<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>c =mcolors.colorConverter.to_rgba(c)<EOL>self._cursorProps = lw, c<EOL>

Set the cursor property as::

  ax.set_cursor_props(linewidth, color)

or::

  ax.set_cursor_props((linewidth, color))

ACCEPTS: a (*float*, *color*) tuple


raise DeprecationWarning('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>

Register observers to be notified when certain events occur.  Register
with callback functions with the following signatures.  The function
has the following signature::

    func(ax)  # where ax is the instance making the callback.

The following events can be connected to:

  'xlim_changed','ylim_changed'

The connection id is is returned - you can use this with
disconnect to disconnect from the axes event


if callable(self._contains): return self._contains(self,mouseevent)<EOL>return self.patch.contains(mouseevent)<EOL>

Test whether the mouse event occured in the axes.

        Returns T/F, {}


if len(args)><NUM_LIT:1>:<EOL><INDENT>raise DeprecationWarning('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>martist.Artist.pick(self,args[<NUM_LIT:0>])<EOL>

call signature::

    pick(mouseevent)

each child artist will fire a pick event if mouseevent is over
the artist and the artist has picker set


def __pick(self, x, y, trans=None, among=None):

<EOL>if trans is not None:<EOL><INDENT>xywin = trans.transform_point((x,y))<EOL><DEDENT>else:<EOL><INDENT>xywin = x,y<EOL><DEDENT>def dist_points(p1, p2):<EOL><INDENT>'<STR_LIT>'<EOL>x1, y1 = p1<EOL>x2, y2 = p2<EOL>return math.sqrt((x1-x2)**<NUM_LIT:2>+(y1-y2)**<NUM_LIT:2>)<EOL><DEDENT>def dist_x_y(p1, x, y):<EOL><INDENT>'<STR_LIT>'<EOL>x1, y1 = p1<EOL>return min(np.sqrt((x-x1)**<NUM_LIT:2>+(y-y1)**<NUM_LIT:2>))<EOL><DEDENT>def dist(a):<EOL><INDENT>if isinstance(a, Text):<EOL><INDENT>bbox = a.get_window_extent()<EOL>l,b,w,h = bbox.bounds<EOL>verts = (l,b), (l,b+h), (l+w,b+h), (l+w, b)<EOL>xt, yt = list(zip(*verts))<EOL><DEDENT>elif isinstance(a, Patch):<EOL><INDENT>path = a.get_path()<EOL>tverts = a.get_transform().transform_path(path)<EOL>xt, yt = list(zip(*tverts))<EOL><DEDENT>elif isinstance(a, mlines.Line2D):<EOL><INDENT>xdata = a.get_xdata(orig=False)<EOL>ydata = a.get_ydata(orig=False)<EOL>xt, yt = a.get_transform().numerix_x_y(xdata, ydata)<EOL><DEDENT>return dist_x_y(xywin, np.asarray(xt), np.asarray(yt))<EOL><DEDENT>artists = self.lines + self.patches + self.texts<EOL>if callable(among):<EOL><INDENT>artists = list(filter(test, artists))<EOL><DEDENT>elif iterable(among):<EOL><INDENT>amongd = dict([(k,<NUM_LIT:1>) for k in among])<EOL>artists = [a for a in artists if a in amongd]<EOL><DEDENT>elif among is None:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if not len(artists): return None<EOL>ds = [ (dist(a),a) for a in artists]<EOL>ds.sort()<EOL>return ds[<NUM_LIT:0>][<NUM_LIT:1>]<EOL>

Return the artist under point that is closest to the *x*, *y*.
If *trans* is *None*, *x*, and *y* are in window coords,
(0,0 = lower left).  Otherwise, *trans* is a
:class:`~matplotlib.transforms.Transform` that specifies the
coordinate system of *x*, *y*.

The selection of artists from amongst which the pick function
finds an artist can be narrowed using the optional keyword
argument *among*. If provided, this should be either a sequence
of permitted artists or a function taking an artist as its
argument and returning a true value if and only if that artist
can be selected.

Note this algorithm calculates distance to the vertices of the
polygon, so if you want to pick a patch, click on the edge!


return self.title.get_text()<EOL>


def set_title(self, label, fontdict=None, **kwargs):

default = {<EOL>'<STR_LIT>':rcParams['<STR_LIT>'],<EOL>'<STR_LIT>' : '<STR_LIT>',<EOL>'<STR_LIT>' : '<STR_LIT>'<EOL>}<EOL>self.title.set_text(label)<EOL>self.title.update(default)<EOL>if fontdict is not None: self.title.update(fontdict)<EOL>self.title.update(kwargs)<EOL>return self.title<EOL>

call signature::

  set_title(label, fontdict=None, **kwargs):

Set the title for the axes.

kwargs are Text properties:
%(Text)s

ACCEPTS: str

.. seealso::
    :meth:`text`:
        for information on how override and the optional args work


label = self.xaxis.get_label()<EOL>return label.get_text()<EOL>


def set_xlabel(self, xlabel, fontdict=None, **kwargs):

label = self.xaxis.get_label()<EOL>label.set_text(xlabel)<EOL>if fontdict is not None: label.update(fontdict)<EOL>label.update(kwargs)<EOL>return label<EOL>

call signature::

  set_xlabel(xlabel, fontdict=None, **kwargs)

Set the label for the xaxis.

Valid kwargs are Text properties:
%(Text)s
ACCEPTS: str

.. seealso::
    :meth:`text`:
        for information on how override and the optional args work


label = self.yaxis.get_label()<EOL>return label.get_text()<EOL>


def set_ylabel(self, ylabel, fontdict=None, **kwargs):

label = self.yaxis.get_label()<EOL>label.set_text(ylabel)<EOL>if fontdict is not None: label.update(fontdict)<EOL>label.update(kwargs)<EOL>return label<EOL>

call signature::

  set_ylabel(ylabel, fontdict=None, **kwargs)

Set the label for the yaxis

Valid kwargs are Text properties:
%(Text)s
ACCEPTS: str

.. seealso::
    :meth:`text`:
        for information on how override and the optional args work


def text(self, x, y, s, fontdict=None,<EOL>withdash=False, **kwargs):

default = {<EOL>'<STR_LIT>' : '<STR_LIT>',<EOL>'<STR_LIT>' : '<STR_LIT:left>',<EOL>'<STR_LIT>' : self.transData,<EOL>}<EOL>if withdash:<EOL><INDENT>t = mtext.TextWithDash(<EOL>x=x, y=y, text=s,<EOL>)<EOL><DEDENT>else:<EOL><INDENT>t = mtext.Text(<EOL>x=x, y=y, text=s,<EOL>)<EOL><DEDENT>self._set_artist_props(t)<EOL>t.update(default)<EOL>if fontdict is not None: t.update(fontdict)<EOL>t.update(kwargs)<EOL>self.texts.append(t)<EOL>t._remove_method = lambda h: self.texts.remove(h)<EOL>if '<STR_LIT>' in kwargs:  t.set_clip_box(self.bbox)<EOL>return t<EOL>

call signature::

   text(x, y, s, fontdict=None, **kwargs)

 Add text in string *s* to axis at location *x*, *y*, data
 coordinates.

 Keyword arguments:

   *fontdict*:
     A dictionary to override the default text properties.
     If *fontdict* is *None*, the defaults are determined by your rc
     parameters.

   *withdash*: [ False | True ]
     Creates a :class:`~matplotlib.text.TextWithDash` instance
     instead of a :class:`~matplotlib.text.Text` instance.

 Individual keyword arguments can be used to override any given
 parameter::

     text(x, y, s, fontsize=12)

 The default transform specifies that text is in data coords,
 alternatively, you can specify text in axis coords (0,0 is
 lower-left and 1,1 is upper-right).  The example below places
 text in the center of the axes::

     text(0.5, 0.5,'matplotlib',
          horizontalalignment='center',
          verticalalignment='center',
          transform = ax.transAxes)

You can put a rectangular box around the text instance (eg. to
set a background color) by using the keyword *bbox*.  *bbox* is
a dictionary of :class:`matplotlib.patches.Rectangle`
properties.  For example::

  text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))

Valid kwargs are :class:`matplotlib.text.Text` properties:

%(Text)s


a = mtext.Annotation(*args, **kwargs)<EOL>a.set_transform(mtransforms.IdentityTransform())<EOL>self._set_artist_props(a)<EOL>if '<STR_LIT>' in kwargs:  a.set_clip_path(self.patch)<EOL>self.texts.append(a)<EOL>return a<EOL>

call signature::

  annotate(s, xy, xytext=None, xycoords='data',
           textcoords='data', arrowprops=None, **kwargs)

Keyword arguments:

%(Annotation)s

.. plot:: mpl_examples/pylab_examples/annotation_demo2.py


def axhline(self, y=<NUM_LIT:0>, xmin=<NUM_LIT:0>, xmax=<NUM_LIT:1>, **kwargs):

ymin, ymax = self.get_ybound()<EOL>yy = self.convert_yunits( y )<EOL>scaley = (yy<ymin) or (yy>ymax)<EOL>trans = mtransforms.blended_transform_factory(<EOL>self.transAxes, self.transData)<EOL>l = mlines.Line2D([xmin,xmax], [y,y], transform=trans, **kwargs)<EOL>l.x_isdata = False<EOL>self.add_line(l)<EOL>self.autoscale_view(scalex=False, scaley=scaley)<EOL>return l<EOL>

call signature::

  axhline(y=0, xmin=0, xmax=1, **kwargs)

Axis Horizontal Line

Draw a horizontal line at *y* from *xmin* to *xmax*.  With the
default values of *xmin* = 0 and *xmax* = 1, this line will
always span the horizontal extent of the axes, regardless of
the xlim settings, even if you change them, eg. with the
:meth:`set_xlim` command.  That is, the horizontal extent is
in axes coords: 0=left, 0.5=middle, 1.0=right but the *y*
location is in data coordinates.

Return value is the :class:`~matplotlib.lines.Line2D`
instance.  kwargs are the same as kwargs to plot, and can be
used to control the line properties.  Eg.,

* draw a thick red hline at *y* = 0 that spans the xrange

    >>> axhline(linewidth=4, color='r')

* draw a default hline at *y* = 1 that spans the xrange

    >>> axhline(y=1)

* draw a default hline at *y* = .5 that spans the the middle half of
  the xrange

    >>> axhline(y=.5, xmin=0.25, xmax=0.75)

Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:

%(Line2D)s

.. seealso::
    :meth:`axhspan`:
        for example plot and source code


def axvline(self, x=<NUM_LIT:0>, ymin=<NUM_LIT:0>, ymax=<NUM_LIT:1>, **kwargs):

xmin, xmax = self.get_xbound()<EOL>xx = self.convert_xunits( x )<EOL>scalex = (xx<xmin) or (xx>xmax)<EOL>trans = mtransforms.blended_transform_factory(<EOL>self.transData, self.transAxes)<EOL>l = mlines.Line2D([x,x], [ymin,ymax] , transform=trans, **kwargs)<EOL>l.y_isdata = False<EOL>self.add_line(l)<EOL>self.autoscale_view(scalex=scalex, scaley=False)<EOL>return l<EOL>

call signature::

  axvline(x=0, ymin=0, ymax=1, **kwargs)

Axis Vertical Line

Draw a vertical line at *x* from *ymin* to *ymax*.  With the
default values of *ymin* = 0 and *ymax* = 1, this line will
always span the vertical extent of the axes, regardless of the
xlim settings, even if you change them, eg. with the
:meth:`set_xlim` command.  That is, the vertical extent is in
axes coords: 0=bottom, 0.5=middle, 1.0=top but the *x* location
is in data coordinates.

Return value is the :class:`~matplotlib.lines.Line2D`
instance.  kwargs are the same as kwargs to plot, and can be
used to control the line properties.  Eg.,

* draw a thick red vline at *x* = 0 that spans the yrange

    >>> axvline(linewidth=4, color='r')

* draw a default vline at *x* = 1 that spans the yrange

    >>> axvline(x=1)

* draw a default vline at *x* = .5 that spans the the middle half of
  the yrange

    >>> axvline(x=.5, ymin=0.25, ymax=0.75)

Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:

%(Line2D)s

.. seealso::
    :meth:`axhspan`:
        for example plot and source code


def axhspan(self, ymin, ymax, xmin=<NUM_LIT:0>, xmax=<NUM_LIT:1>, **kwargs):

trans = mtransforms.blended_transform_factory(<EOL>self.transAxes, self.transData)<EOL>self._process_unit_info( [xmin, xmax], [ymin, ymax], kwargs=kwargs )<EOL>xmin, xmax = self.convert_xunits( [xmin, xmax] )<EOL>ymin, ymax = self.convert_yunits( [ymin, ymax] )<EOL>verts = (xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)<EOL>p = mpatches.Polygon(verts, **kwargs)<EOL>p.set_transform(trans)<EOL>p.x_isdata = False<EOL>self.add_patch(p)<EOL>return p<EOL>

call signature::

  axhspan(ymin, ymax, xmin=0, xmax=1, **kwargs)

Axis Horizontal Span.

*y* coords are in data units and *x* coords are in axes (relative
0-1) units.

Draw a horizontal span (rectangle) from *ymin* to *ymax*.
With the default values of *xmin* = 0 and *xmax* = 1, this
always spans the xrange, regardless of the xlim settings, even
if you change them, eg. with the :meth:`set_xlim` command.
That is, the horizontal extent is in axes coords: 0=left,
0.5=middle, 1.0=right but the *y* location is in data
coordinates.

Return value is a :class:`matplotlib.patches.Polygon`
instance.

Examples:

* draw a gray rectangle from *y* = 0.25-0.75 that spans the
  horizontal extent of the axes

    >>> axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)

Valid kwargs are :class:`~matplotlib.patches.Polygon` properties:

%(Polygon)s

**Example:**

.. plot:: mpl_examples/pylab_examples/axhspan_demo.py


def axvspan(self, xmin, xmax, ymin=<NUM_LIT:0>, ymax=<NUM_LIT:1>, **kwargs):

trans = mtransforms.blended_transform_factory(<EOL>self.transData, self.transAxes)<EOL>self._process_unit_info( [xmin, xmax], [ymin, ymax], kwargs=kwargs )<EOL>xmin, xmax = self.convert_xunits( [xmin, xmax] )<EOL>ymin, ymax = self.convert_yunits( [ymin, ymax] )<EOL>verts = [(xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)]<EOL>p = mpatches.Polygon(verts, **kwargs)<EOL>p.set_transform(trans)<EOL>p.y_isdata = False<EOL>self.add_patch(p)<EOL>return p<EOL>

call signature::

  axvspan(xmin, xmax, ymin=0, ymax=1, **kwargs)

Axis Vertical Span.

*x* coords are in data units and *y* coords are in axes (relative
0-1) units.

Draw a vertical span (rectangle) from *xmin* to *xmax*.  With
the default values of *ymin* = 0 and *ymax* = 1, this always
spans the yrange, regardless of the ylim settings, even if you
change them, eg. with the :meth:`set_ylim` command.  That is,
the vertical extent is in axes coords: 0=bottom, 0.5=middle,
1.0=top but the *y* location is in data coordinates.

Return value is the :class:`matplotlib.patches.Polygon`
instance.

Examples:

* draw a vertical green translucent rectangle from x=1.25 to 1.55 that
  spans the yrange of the axes

    >>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)

Valid kwargs are :class:`~matplotlib.patches.Polygon`
properties:

%(Polygon)s

.. seealso::
    :meth:`axhspan`:
        for example plot and source code


def hlines(self, y, xmin, xmax, colors='<STR_LIT:k>', linestyles='<STR_LIT>',<EOL>label='<STR_LIT>', **kwargs):

if kwargs.get('<STR_LIT>') is not None:<EOL><INDENT>raise DeprecationWarning('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>y = self.convert_yunits( y )<EOL>xmin = self.convert_xunits( xmin )<EOL>xmax = self.convert_xunits( xmax )<EOL>if not iterable(y): y = [y]<EOL>if not iterable(xmin): xmin = [xmin]<EOL>if not iterable(xmax): xmax = [xmax]<EOL>y = np.asarray(y)<EOL>xmin = np.asarray(xmin)<EOL>xmax = np.asarray(xmax)<EOL>if len(xmin)==<NUM_LIT:1>:<EOL><INDENT>xmin = np.resize( xmin, y.shape )<EOL><DEDENT>if len(xmax)==<NUM_LIT:1>:<EOL><INDENT>xmax = np.resize( xmax, y.shape )<EOL><DEDENT>if len(xmin)!=len(y):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if len(xmax)!=len(y):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>verts = [ ((thisxmin, thisy), (thisxmax, thisy))<EOL>for thisxmin, thisxmax, thisy in zip(xmin, xmax, y)]<EOL>coll = mcoll.LineCollection(verts, colors=colors,<EOL>linestyles=linestyles, label=label)<EOL>self.add_collection(coll)<EOL>coll.update(kwargs)<EOL>minx = min(xmin.min(), xmax.min())<EOL>maxx = max(xmin.max(), xmax.max())<EOL>miny = y.min()<EOL>maxy = y.max()<EOL>corners = (minx, miny), (maxx, maxy)<EOL>self.update_datalim(corners)<EOL>self.autoscale_view()<EOL>return coll<EOL>

call signature::

  hlines(y, xmin, xmax, colors='k', linestyles='solid', **kwargs)

Plot horizontal lines at each *y* from *xmin* to *xmax*.

Returns the :class:`~matplotlib.collections.LineCollection`
that was added.

Required arguments:

  *y*:
    a 1-D numpy array or iterable.

  *xmin* and *xmax*:
    can be scalars or ``len(x)`` numpy arrays.  If they are
    scalars, then the respective values are constant, else the
    widths of the lines are determined by *xmin* and *xmax*.

Optional keyword arguments:

  *colors*:
    a line collections color argument, either a single color
    or a ``len(y)`` list of colors

  *linestyles*:
    [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ]

**Example:**

.. plot:: mpl_examples/pylab_examples/hline_demo.py


def vlines(self, x, ymin, ymax, colors='<STR_LIT:k>', linestyles='<STR_LIT>',<EOL>label='<STR_LIT>', **kwargs):

if kwargs.get('<STR_LIT>') is not None:<EOL><INDENT>raise DeprecationWarning('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>self._process_unit_info(xdata=x, ydata=ymin, kwargs=kwargs)<EOL>x = self.convert_xunits( x )<EOL>ymin = self.convert_yunits( ymin )<EOL>ymax = self.convert_yunits( ymax )<EOL>if not iterable(x): x = [x]<EOL>if not iterable(ymin): ymin = [ymin]<EOL>if not iterable(ymax): ymax = [ymax]<EOL>x = np.asarray(x)<EOL>ymin = np.asarray(ymin)<EOL>ymax = np.asarray(ymax)<EOL>if len(ymin)==<NUM_LIT:1>:<EOL><INDENT>ymin = np.resize( ymin, x.shape )<EOL><DEDENT>if len(ymax)==<NUM_LIT:1>:<EOL><INDENT>ymax = np.resize( ymax, x.shape )<EOL><DEDENT>if len(ymin)!=len(x):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if len(ymax)!=len(x):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>Y = np.array([ymin, ymax]).T<EOL>verts = [ ((thisx, thisymin), (thisx, thisymax))<EOL>for thisx, (thisymin, thisymax) in zip(x,Y)]<EOL>coll = mcoll.LineCollection(verts, colors=colors,<EOL>linestyles=linestyles, label=label)<EOL>self.add_collection(coll)<EOL>coll.update(kwargs)<EOL>minx = min( x )<EOL>maxx = max( x )<EOL>miny = min( min(ymin), min(ymax) )<EOL>maxy = max( max(ymin), max(ymax) )<EOL>corners = (minx, miny), (maxx, maxy)<EOL>self.update_datalim(corners)<EOL>self.autoscale_view()<EOL>return coll<EOL>

call signature::

  vlines(x, ymin, ymax, color='k', linestyles='solid')

Plot vertical lines at each *x* from *ymin* to *ymax*.  *ymin*
or *ymax* can be scalars or len(*x*) numpy arrays.  If they are
scalars, then the respective values are constant, else the
heights of the lines are determined by *ymin* and *ymax*.

*colors*
  a line collections color args, either a single color
  or a len(*x*) list of colors

*linestyles*

  one of [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ]

Returns the :class:`matplotlib.collections.LineCollection`
that was added.

kwargs are :class:`~matplotlib.collections.LineCollection` properties:

%(LineCollection)s


scalex = kwargs.pop( '<STR_LIT>', True)<EOL>scaley = kwargs.pop( '<STR_LIT>', True)<EOL>if not self._hold: self.cla()<EOL>lines = []<EOL>for line in self._get_lines(*args, **kwargs):<EOL><INDENT>self.add_line(line)<EOL>lines.append(line)<EOL><DEDENT>self.autoscale_view(scalex=scalex, scaley=scaley)<EOL>return lines<EOL>

Plot lines and/or markers to the
:class:`~matplotlib.axes.Axes`.  *args* is a variable length
argument, allowing for multiple *x*, *y* pairs with an
optional format string.  For example, each of the following is
legal::

    plot(x, y)         # plot x and y using default line style and color
    plot(x, y, 'bo')   # plot x and y using blue circle markers
    plot(y)            # plot y using x as index array 0..N-1
    plot(y, 'r+')      # ditto, but with red plusses

If *x* and/or *y* is 2-dimensional, then the corresponding columns
will be plotted.

An arbitrary number of *x*, *y*, *fmt* groups can be
specified, as in::

    a.plot(x1, y1, 'g^', x2, y2, 'g-')

Return value is a list of lines that were added.

The following format string characters are accepted to control
the line style or marker:

================    ===============================
character           description
================    ===============================
'-'                 solid line style
'--'                dashed line style
'-.'                dash-dot line style
':'                 dotted line style
'.'                 point marker
','                 pixel marker
'o'                 circle marker
'v'                 triangle_down marker
'^'                 triangle_up marker
'<'                 triangle_left marker
'>'                 triangle_right marker
'1'                 tri_down marker
'2'                 tri_up marker
'3'                 tri_left marker
'4'                 tri_right marker
's'                 square marker
'p'                 pentagon marker
'*'                 star marker
'h'                 hexagon1 marker
'H'                 hexagon2 marker
'+'                 plus marker
'x'                 x marker
'D'                 diamond marker
'd'                 thin_diamond marker
'|'                 vline marker
'_'                 hline marker
================    ===============================

The following color abbreviations are supported:

==========  ========
character   color
==========  ========
'b'         blue
'g'         green
'r'         red
'c'         cyan
'm'         magenta
'y'         yellow
'k'         black
'w'         white
==========  ========

In addition, you can specify colors in many weird and
wonderful ways, including full names (``'green'``), hex
strings (``'#008000'``), RGB or RGBA tuples (``(0,1,0,1)``) or
grayscale intensities as a string (``'0.8'``).  Of these, the
string specifications can be used in place of a ``fmt`` group,
but the tuple forms can be used only as ``kwargs``.

Line styles and colors are combined in a single format string, as in
``'bo'`` for blue circles.

The *kwargs* can be used to set line properties (any property that has
a ``set_*`` method).  You can use this to set a line label (for auto
legends), linewidth, anitialising, marker face color, etc.  Here is an
example::

    plot([1,2,3], [1,2,3], 'go-', label='line 1', linewidth=2)
    plot([1,2,3], [1,4,9], 'rs',  label='line 2')
    axis([0, 4, 0, 10])
    legend()

If you make multiple lines with one plot command, the kwargs
apply to all those lines, e.g.::

    plot(x1, y1, x2, y2, antialised=False)

Neither line will be antialiased.

You do not need to use format strings, which are just
abbreviations.  All of the line properties can be controlled
by keyword arguments.  For example, you can set the color,
marker, linestyle, and markercolor with::

    plot(x, y, color='green', linestyle='dashed', marker='o',
         markerfacecolor='blue', markersize=12).  See
         :class:`~matplotlib.lines.Line2D` for details.

The kwargs are :class:`~matplotlib.lines.Line2D` properties:

%(Line2D)s

kwargs *scalex* and *scaley*, if defined, are passed on to
:meth:`~matplotlib.axes.Axes.autoscale_view` to determine
whether the *x* and *y* axes are autoscaled; the default is
*True*.


def plot_date(self, x, y, fmt='<STR_LIT>', tz=None, xdate=True, ydate=False,<EOL>**kwargs):

if not self._hold: self.cla()<EOL>ret = self.plot(x, y, fmt, **kwargs)<EOL>if xdate:<EOL><INDENT>self.xaxis_date(tz)<EOL><DEDENT>if ydate:<EOL><INDENT>self.yaxis_date(tz)<EOL><DEDENT>self.autoscale_view()<EOL>return ret<EOL>

call signature::

  plot_date(x, y, fmt='bo', tz=None, xdate=True, ydate=False, **kwargs)

Similar to the :func:`~matplotlib.pyplot.plot` command, except
the *x* or *y* (or both) data is considered to be dates, and the
axis is labeled accordingly.

*x* and/or *y* can be a sequence of dates represented as float
days since 0001-01-01 UTC.

Keyword arguments:

  *fmt*: string
    The plot format string.

  *tz*: [ None | timezone string ]
    The time zone to use in labeling dates. If *None*, defaults to rc
    value.

  *xdate*: [ True | False ]
    If *True*, the *x*-axis will be labeled with dates.

  *ydate*: [ False | True ]
    If *True*, the *y*-axis will be labeled with dates.

Note if you are using custom date tickers and formatters, it
may be necessary to set the formatters/locators after the call
to :meth:`plot_date` since :meth:`plot_date` will set the
default tick locator to
:class:`matplotlib.ticker.AutoDateLocator` (if the tick
locator is not already set to a
:class:`matplotlib.ticker.DateLocator` instance) and the
default tick formatter to
:class:`matplotlib.ticker.AutoDateFormatter` (if the tick
formatter is not already set to a
:class:`matplotlib.ticker.DateFormatter` instance).

Valid kwargs are :class:`~matplotlib.lines.Line2D` properties:

%(Line2D)s

.. seealso::
    :mod:`~matplotlib.dates`:
        for helper functions

    :func:`~matplotlib.dates.date2num`,
    :func:`~matplotlib.dates.num2date` and
    :func:`~matplotlib.dates.drange`:
        for help on creating the required floating point
        dates.


if not self._hold: self.cla()<EOL>dx = {'<STR_LIT>': kwargs.pop('<STR_LIT>', <NUM_LIT:10>),<EOL>'<STR_LIT>': kwargs.pop('<STR_LIT>', None),<EOL>}<EOL>dy = {'<STR_LIT>': kwargs.pop('<STR_LIT>', <NUM_LIT:10>),<EOL>'<STR_LIT>': kwargs.pop('<STR_LIT>', None),<EOL>}<EOL>self.set_xscale('<STR_LIT>', **dx)<EOL>self.set_yscale('<STR_LIT>', **dy)<EOL>b =  self._hold<EOL>self._hold = True <EOL>l = self.plot(*args, **kwargs)<EOL>self._hold = b    <EOL>return l<EOL>

call signature::

  loglog(*args, **kwargs)

Make a plot with log scaling on the *x* and *y* axis.

:func:`~matplotlib.pyplot.loglog` supports all the keyword
arguments of :func:`~matplotlib.pyplot.plot` and
:meth:`matplotlib.axes.Axes.set_xscale` /
:meth:`matplotlib.axes.Axes.set_yscale`.

Notable keyword arguments:

  *basex*/*basey*: scalar > 1
    base of the *x*/*y* logarithm

  *subsx*/*subsy*: [ None | sequence ]
    the location of the minor *x*/*y* ticks; *None* defaults
    to autosubs, which depend on the number of decades in the
    plot; see :meth:`matplotlib.axes.Axes.set_xscale` /
    :meth:`matplotlib.axes.Axes.set_yscale` for details

The remaining valid kwargs are
:class:`~matplotlib.lines.Line2D` properties:

%(Line2D)s

**Example:**

.. plot:: mpl_examples/pylab_examples/log_demo.py


if not self._hold: self.cla()<EOL>d = {'<STR_LIT>': kwargs.pop( '<STR_LIT>', <NUM_LIT:10>),<EOL>'<STR_LIT>': kwargs.pop( '<STR_LIT>', None),<EOL>}<EOL>self.set_xscale('<STR_LIT>', **d)<EOL>b =  self._hold<EOL>self._hold = True <EOL>l = self.plot(*args, **kwargs)<EOL>self._hold = b    <EOL>return l<EOL>

call signature::

  semilogx(*args, **kwargs)

Make a plot with log scaling on the *x* axis.

:func:`semilogx` supports all the keyword arguments of
:func:`~matplotlib.pyplot.plot` and
:meth:`matplotlib.axes.Axes.set_xscale`.

Notable keyword arguments:

  *basex*: scalar > 1
    base of the *x* logarithm

  *subsx*: [ None | sequence ]
    The location of the minor xticks; *None* defaults to
    autosubs, which depend on the number of decades in the
    plot; see :meth:`~matplotlib.axes.Axes.set_xscale` for
    details.

The remaining valid kwargs are
:class:`~matplotlib.lines.Line2D` properties:

%(Line2D)s

.. seealso::
    :meth:`loglog`:
        For example code and figure


if not self._hold: self.cla()<EOL>d = {'<STR_LIT>': kwargs.pop('<STR_LIT>', <NUM_LIT:10>),<EOL>'<STR_LIT>': kwargs.pop('<STR_LIT>', None),<EOL>}<EOL>self.set_yscale('<STR_LIT>', **d)<EOL>b =  self._hold<EOL>self._hold = True <EOL>l = self.plot(*args, **kwargs)<EOL>self._hold = b    <EOL>return l<EOL>

call signature::

  semilogy(*args, **kwargs)

Make a plot with log scaling on the *y* axis.

:func:`semilogy` supports all the keyword arguments of
:func:`~matplotlib.pylab.plot` and
:meth:`matplotlib.axes.Axes.set_yscale`.

Notable keyword arguments:

  *basey*: scalar > 1
    Base of the *y* logarithm

  *subsy*: [ None | sequence ]
    The location of the minor yticks; *None* defaults to
    autosubs, which depend on the number of decades in the
    plot; see :meth:`~matplotlib.axes.Axes.set_yscale` for
    details.

The remaining valid kwargs are
:class:`~matplotlib.lines.Line2D` properties:

%(Line2D)s

.. seealso::
    :meth:`loglog`:
        For example code and figure


return self.xcorr(x, x, **kwargs)<EOL>

call signature::

    acorr(x, normed=False, detrend=mlab.detrend_none, usevlines=False,
          maxlags=None, **kwargs)

Plot the autocorrelation of *x*.  If *normed* = *True*,
normalize the data by the autocorrelation at 0-th lag.  *x* is
detrended by the *detrend* callable (default no normalization).

Data are plotted as ``plot(lags, c, **kwargs)``

Return value is a tuple (*lags*, *c*, *line*) where:

  - *lags* are a length 2*maxlags+1 lag vector

  - *c* is the 2*maxlags+1 auto correlation vector

  - *line* is a :class:`~matplotlib.lines.Line2D` instance
    returned by :meth:`plot`

The default *linestyle* is None and the default *marker* is
``'o'``, though these can be overridden with keyword args.
The cross correlation is performed with
:func:`numpy.correlate` with *mode* = 2.

If *usevlines* is *True*, :meth:`~matplotlib.axes.Axes.vlines`
rather than :meth:`~matplotlib.axes.Axes.plot` is used to draw
vertical lines from the origin to the acorr.  Otherwise, the
plot style is determined by the kwargs, which are
:class:`~matplotlib.lines.Line2D` properties.

*maxlags* is a positive integer detailing the number of lags
to show.  The default value of *None* will return all
:math:`2 \mathrm{len}(x) - 1` lags.

The return value is a tuple (*lags*, *c*, *linecol*, *b*)
where

- *linecol* is the
  :class:`~matplotlib.collections.LineCollection`

- *b* is the *x*-axis.

.. seealso::
    :meth:`~matplotlib.axes.Axes.plot` or
    :meth:`~matplotlib.axes.Axes.vlines`: For documentation on
    valid kwargs.

**Example:**

:func:`~matplotlib.pyplot.xcorr` above, and
:func:`~matplotlib.pyplot.acorr` below.

**Example:**

.. plot:: mpl_examples/pylab_examples/xcorr_demo.py


def xcorr(self, x, y, normed=False, detrend=mlab.detrend_none,<EOL>usevlines=False, maxlags=None, **kwargs):

Nx = len(x)<EOL>if Nx!=len(y):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>x = detrend(np.asarray(x))<EOL>y = detrend(np.asarray(y))<EOL>c = np.correlate(x, y, mode=<NUM_LIT:2>)<EOL>if normed: c/= np.sqrt(np.dot(x,x) * np.dot(y,y))<EOL>if maxlags is None: maxlags = Nx - <NUM_LIT:1><EOL>if maxlags >= Nx or maxlags < <NUM_LIT:1>:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>'%Nx)<EOL><DEDENT>lags = np.arange(-maxlags,maxlags+<NUM_LIT:1>)<EOL>c = c[Nx-<NUM_LIT:1>-maxlags:Nx+maxlags]<EOL>if usevlines:<EOL><INDENT>a = self.vlines(lags, [<NUM_LIT:0>], c, **kwargs)<EOL>b = self.axhline(**kwargs)<EOL><DEDENT>else:<EOL><INDENT>kwargs.setdefault('<STR_LIT>', '<STR_LIT:o>')<EOL>kwargs.setdefault('<STR_LIT>', '<STR_LIT:None>')<EOL>a, = self.plot(lags, c, **kwargs)<EOL>b = None<EOL><DEDENT>return lags, c, a, b<EOL>

call signature::

  xcorr(x, y, normed=False, detrend=mlab.detrend_none,
        usevlines=False, **kwargs):

Plot the cross correlation between *x* and *y*.  If *normed* =
*True*, normalize the data by the cross correlation at 0-th
lag.  *x* and y are detrended by the *detrend* callable
(default no normalization).  *x* and *y* must be equal length.

Data are plotted as ``plot(lags, c, **kwargs)``

Return value is a tuple (*lags*, *c*, *line*) where:

  - *lags* are a length ``2*maxlags+1`` lag vector

  - *c* is the ``2*maxlags+1`` auto correlation vector

  - *line* is a :class:`~matplotlib.lines.Line2D` instance
     returned by :func:`~matplotlib.pyplot.plot`.

The default *linestyle* is *None* and the default *marker* is
'o', though these can be overridden with keyword args.  The
cross correlation is performed with :func:`numpy.correlate`
with *mode* = 2.

If *usevlines* is *True*:

   :func:`~matplotlib.pyplot.vlines`
   rather than :func:`~matplotlib.pyplot.plot` is used to draw
   vertical lines from the origin to the xcorr.  Otherwise the
   plotstyle is determined by the kwargs, which are
   :class:`~matplotlib.lines.Line2D` properties.

   The return value is a tuple (*lags*, *c*, *linecol*, *b*)
   where *linecol* is the
   :class:`matplotlib.collections.LineCollection` instance and
   *b* is the *x*-axis.

*maxlags* is a positive integer detailing the number of lags to show.
The default value of *None* will return all ``(2*len(x)-1)`` lags.

**Example:**

:func:`~matplotlib.pyplot.xcorr` above, and
:func:`~matplotlib.pyplot.acorr` below.

**Example:**

.. plot:: mpl_examples/pylab_examples/xcorr_demo.py


def get_handles():<EOL><INDENT>handles = self.lines[:]<EOL>handles.extend(self.patches)<EOL>handles.extend([c for c in self.collections<EOL>if isinstance(c, mcoll.LineCollection)])<EOL>handles.extend([c for c in self.collections<EOL>if isinstance(c, mcoll.RegularPolyCollection)])<EOL>return handles<EOL><DEDENT>if len(args)==<NUM_LIT:0>:<EOL><INDENT>handles = []<EOL>labels = []<EOL>for handle in get_handles():<EOL><INDENT>label = handle.get_label()<EOL>if (label is not None and<EOL>label != '<STR_LIT>' and not label.startswith('<STR_LIT:_>')):<EOL><INDENT>handles.append(handle)<EOL>labels.append(label)<EOL><DEDENT><DEDENT>if len(handles) == <NUM_LIT:0>:<EOL><INDENT>warnings.warn("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>return None<EOL><DEDENT><DEDENT>elif len(args)==<NUM_LIT:1>:<EOL><INDENT>labels = args[<NUM_LIT:0>]<EOL>handles = [h for h, label in zip(get_handles(), labels)]<EOL><DEDENT>elif len(args)==<NUM_LIT:2>:<EOL><INDENT>if is_string_like(args[<NUM_LIT:1>]) or isinstance(args[<NUM_LIT:1>], int):<EOL><INDENT>labels, loc = args<EOL>handles = [h for h, label in zip(get_handles(), labels)]<EOL>kwargs['<STR_LIT>'] = loc<EOL><DEDENT>else:<EOL><INDENT>handles, labels = args<EOL><DEDENT><DEDENT>elif len(args)==<NUM_LIT:3>:<EOL><INDENT>handles, labels, loc = args<EOL>kwargs['<STR_LIT>'] = loc<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>handles = cbook.flatten(handles)<EOL>self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)<EOL>return self.legend_<EOL>

call signature::

  legend(*args, **kwargs)

Place a legend on the current axes at location *loc*.  Labels are a
sequence of strings and *loc* can be a string or an integer specifying
the legend location.

To make a legend with existing lines::

  legend()

:meth:`legend` by itself will try and build a legend using the label
property of the lines/patches/collections.  You can set the label of
a line by doing::

  plot(x, y, label='my data')

or::

  line.set_label('my data').

If label is set to '_nolegend_', the item will not be shown in
legend.

To automatically generate the legend from labels::

  legend( ('label1', 'label2', 'label3') )

To make a legend for a list of lines and labels::

  legend( (line1, line2, line3), ('label1', 'label2', 'label3') )

To make a legend at a given location, using a location argument::

  legend( ('label1', 'label2', 'label3'), loc='upper left')

or::

  legend( (line1, line2, line3),  ('label1', 'label2', 'label3'), loc=2)

The location codes are

  ===============   =============
  Location String   Location Code
  ===============   =============
  'best'            0
  'upper right'     1
  'upper left'      2
  'lower left'      3
  'lower right'     4
  'right'           5
  'center left'     6
  'center right'    7
  'lower center'    8
  'upper center'    9
  'center'          10
  ===============   =============

If none of these are locations are suitable, loc can be a 2-tuple
giving x,y in axes coords, ie::

  loc = 0, 1 # left top
  loc = 0.5, 0.5 # center

Keyword arguments:

  *isaxes*: [ True | False ]
    Indicates that this is an axes legend

  *numpoints*: integer
    The number of points in the legend line, default is 4

  *prop*: [ None | FontProperties ]
    A :class:`matplotlib.font_manager.FontProperties`
    instance, or *None* to use rc settings.

  *pad*: [ None | scalar ]
    The fractional whitespace inside the legend border, between 0 and 1.
    If *None*, use rc settings.

  *markerscale*: [ None | scalar ]
    The relative size of legend markers vs. original. If *None*, use rc
    settings.

  *shadow*: [ None | False | True ]
    If *True*, draw a shadow behind legend. If *None*, use rc settings.

  *labelsep*: [ None | scalar ]
    The vertical space between the legend entries. If *None*, use rc
    settings.

  *handlelen*: [ None | scalar ]
    The length of the legend lines. If *None*, use rc settings.

  *handletextsep*: [ None | scalar ]
    The space between the legend line and legend text. If *None*, use rc
    settings.

  *axespad*: [ None | scalar ]
    The border between the axes and legend edge. If *None*, use rc
    settings.

**Example:**

.. plot:: mpl_examples/api/legend_demo.py


where = kwargs.pop('<STR_LIT>', '<STR_LIT>')<EOL>if where not in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>kwargs['<STR_LIT>'] = '<STR_LIT>' + where<EOL>return self.plot(x, y, *args, **kwargs)<EOL>

call signature::

  step(x, y, *args, **kwargs)

Make a step plot. Additional keyword args to :func:`step` are the same
as those for :func:`~matplotlib.pyplot.plot`.

*x* and *y* must be 1-D sequences, and it is assumed, but not checked,
that *x* is uniformly increasing.

Keyword arguments:

*where*: [ 'pre' | 'post' | 'mid'  ]
  If 'pre', the interval from x[i] to x[i+1] has level y[i]

  If 'post', that interval has level y[i+1]

  If 'mid', the jumps in *y* occur half-way between the
  *x*-values.


def bar(self, left, height, width=<NUM_LIT>, bottom=None,<EOL>color=None, edgecolor=None, linewidth=None,<EOL>yerr=None, xerr=None, ecolor=None, capsize=<NUM_LIT:3>,<EOL>align='<STR_LIT>', orientation='<STR_LIT>', log=False,<EOL>**kwargs<EOL>):

if not self._hold: self.cla()<EOL>label = kwargs.pop('<STR_LIT:label>', '<STR_LIT>')<EOL>def make_iterable(x):<EOL><INDENT>if not iterable(x):<EOL><INDENT>return [x]<EOL><DEDENT>else:<EOL><INDENT>return x<EOL><DEDENT><DEDENT>_left = left<EOL>left = make_iterable(left)<EOL>height = make_iterable(height)<EOL>width = make_iterable(width)<EOL>_bottom = bottom<EOL>bottom = make_iterable(bottom)<EOL>linewidth = make_iterable(linewidth)<EOL>adjust_ylim = False<EOL>adjust_xlim = False<EOL>if orientation == '<STR_LIT>':<EOL><INDENT>self._process_unit_info(xdata=left, ydata=height, kwargs=kwargs)<EOL>if log:<EOL><INDENT>self.set_yscale('<STR_LIT>')<EOL><DEDENT>if _bottom is None:<EOL><INDENT>if self.get_yscale() == '<STR_LIT>':<EOL><INDENT>bottom = [<NUM_LIT>]<EOL>adjust_ylim = True<EOL><DEDENT>else:<EOL><INDENT>bottom = [<NUM_LIT:0>]<EOL><DEDENT><DEDENT>nbars = len(left)<EOL>if len(width) == <NUM_LIT:1>:<EOL><INDENT>width *= nbars<EOL><DEDENT>if len(bottom) == <NUM_LIT:1>:<EOL><INDENT>bottom *= nbars<EOL><DEDENT><DEDENT>elif orientation == '<STR_LIT>':<EOL><INDENT>self._process_unit_info(xdata=width, ydata=bottom, kwargs=kwargs)<EOL>if log:<EOL><INDENT>self.set_xscale('<STR_LIT>')<EOL><DEDENT>if _left is None:<EOL><INDENT>if self.get_xscale() == '<STR_LIT>':<EOL><INDENT>left = [<NUM_LIT>]<EOL>adjust_xlim = True<EOL><DEDENT>else:<EOL><INDENT>left = [<NUM_LIT:0>]<EOL><DEDENT><DEDENT>nbars = len(bottom)<EOL>if len(left) == <NUM_LIT:1>:<EOL><INDENT>left *= nbars<EOL><DEDENT>if len(height) == <NUM_LIT:1>:<EOL><INDENT>height *= nbars<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>' % orientation)<EOL><DEDENT>if len(linewidth) < nbars:<EOL><INDENT>linewidth *= nbars<EOL><DEDENT>if color is None:<EOL><INDENT>color = [None] * nbars<EOL><DEDENT>else:<EOL><INDENT>color = list(mcolors.colorConverter.to_rgba_array(color))<EOL>if len(color) < nbars:<EOL><INDENT>color *= nbars<EOL><DEDENT><DEDENT>if edgecolor is None:<EOL><INDENT>edgecolor = [None] * nbars<EOL><DEDENT>else:<EOL><INDENT>edgecolor = list(mcolors.colorConverter.to_rgba_array(edgecolor))<EOL>if len(edgecolor) < nbars:<EOL><INDENT>edgecolor *= nbars<EOL><DEDENT><DEDENT>if yerr is not None:<EOL><INDENT>if not iterable(yerr):<EOL><INDENT>yerr = [yerr]*nbars<EOL><DEDENT><DEDENT>if xerr is not None:<EOL><INDENT>if not iterable(xerr):<EOL><INDENT>xerr = [xerr]*nbars<EOL><DEDENT><DEDENT>assert len(left)==nbars, "<STR_LIT>" % nbars<EOL>assert len(height)==nbars, ("<STR_LIT>" %<EOL>nbars)<EOL>assert len(width)==nbars, ("<STR_LIT>" %<EOL>nbars)<EOL>assert len(bottom)==nbars, ("<STR_LIT>" %<EOL>nbars)<EOL>if yerr is not None and len(yerr)!=nbars:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % nbars)<EOL><DEDENT>if xerr is not None and len(xerr)!=nbars:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % nbars)<EOL><DEDENT>patches = []<EOL>if self.xaxis is not None:<EOL><INDENT>xconv = self.xaxis.converter<EOL>if xconv is not None:<EOL><INDENT>units = self.xaxis.get_units()<EOL>left = xconv.convert( left, units )<EOL>width = xconv.convert( width, units )<EOL><DEDENT><DEDENT>if self.yaxis is not None:<EOL><INDENT>yconv = self.yaxis.converter<EOL>if yconv is not None :<EOL><INDENT>units = self.yaxis.get_units()<EOL>bottom = yconv.convert( bottom, units )<EOL>height = yconv.convert( height, units )<EOL><DEDENT><DEDENT>if align == '<STR_LIT>':<EOL><INDENT>pass<EOL><DEDENT>elif align == '<STR_LIT>':<EOL><INDENT>if orientation == '<STR_LIT>':<EOL><INDENT>left = [left[i] - width[i]/<NUM_LIT> for i in range(len(left))]<EOL><DEDENT>elif orientation == '<STR_LIT>':<EOL><INDENT>bottom = [bottom[i] - height[i]/<NUM_LIT> for i in range(len(bottom))]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>' % align)<EOL><DEDENT>args = list(zip(left, bottom, width, height, color, edgecolor, linewidth))<EOL>for l, b, w, h, c, e, lw in args:<EOL><INDENT>if h<<NUM_LIT:0>:<EOL><INDENT>b += h<EOL>h = abs(h)<EOL><DEDENT>if w<<NUM_LIT:0>:<EOL><INDENT>l += w<EOL>w = abs(w)<EOL><DEDENT>r = mpatches.Rectangle(<EOL>xy=(l, b), width=w, height=h,<EOL>facecolor=c,<EOL>edgecolor=e,<EOL>linewidth=lw,<EOL>label=label<EOL>)<EOL>label = '<STR_LIT>'<EOL>r.update(kwargs)<EOL>self.add_patch(r)<EOL>patches.append(r)<EOL><DEDENT>holdstate = self._hold<EOL>self.hold(True) <EOL>if xerr is not None or yerr is not None:<EOL><INDENT>if orientation == '<STR_LIT>':<EOL><INDENT>x = [l+<NUM_LIT:0.5>*w for l, w in zip(left, width)]<EOL>y = [b+h for b,h in zip(bottom, height)]<EOL><DEDENT>elif orientation == '<STR_LIT>':<EOL><INDENT>x = [l+w for l,w in zip(left, width)]<EOL>y = [b+<NUM_LIT:0.5>*h for b,h in zip(bottom, height)]<EOL><DEDENT>self.errorbar(<EOL>x, y,<EOL>yerr=yerr, xerr=xerr,<EOL>fmt=None, ecolor=ecolor, capsize=capsize)<EOL><DEDENT>self.hold(holdstate) <EOL>if adjust_xlim:<EOL><INDENT>xmin, xmax = self.dataLim.intervalx<EOL>xmin = np.amin(width[width!=<NUM_LIT:0>]) <EOL>if xerr is not None:<EOL><INDENT>xmin = xmin - np.amax(xerr)<EOL><DEDENT>xmin = max(xmin*<NUM_LIT>, <NUM_LIT>)<EOL>self.dataLim.intervalx = (xmin, xmax)<EOL><DEDENT>if adjust_ylim:<EOL><INDENT>ymin, ymax = self.dataLim.intervaly<EOL>ymin = np.amin(height[height!=<NUM_LIT:0>]) <EOL>if yerr is not None:<EOL><INDENT>ymin = ymin - np.amax(yerr)<EOL><DEDENT>ymin = max(ymin*<NUM_LIT>, <NUM_LIT>)<EOL>self.dataLim.intervaly = (ymin, ymax)<EOL><DEDENT>self.autoscale_view()<EOL>return patches<EOL>

call signature::

  bar(left, height, width=0.8, bottom=0,
      color=None, edgecolor=None, linewidth=None,
      yerr=None, xerr=None, ecolor=None, capsize=3,
      align='edge', orientation='vertical', log=False)

Make a bar plot with rectangles bounded by:

  *left*, *left* + *width*, *bottom*, *bottom* + *height*
        (left, right, bottom and top edges)

*left*, *height*, *width*, and *bottom* can be either scalars
or sequences

Return value is a list of
:class:`matplotlib.patches.Rectangle` instances.

Required arguments:

  ========   ===============================================
  Argument   Description
  ========   ===============================================
  *left*     the x coordinates of the left sides of the bars
  *height*   the heights of the bars
  ========   ===============================================

Optional keyword arguments:

  ===============   ==========================================
  Keyword           Description
  ===============   ==========================================
  *width*           the widths of the bars
  *bottom*          the y coordinates of the bottom edges of
                    the bars
  *color*           the colors of the bars
  *edgecolor*       the colors of the bar edges
  *linewidth*       width of bar edges; None means use default
                    linewidth; 0 means don't draw edges.
  *xerr*            if not None, will be used to generate
                    errorbars on the bar chart
  *yerr*            if not None, will be used to generate
                    errorbars on the bar chart
  *ecolor*          specifies the color of any errorbar
  *capsize*         (default 3) determines the length in
                    points of the error bar caps
  *align*           'edge' (default) | 'center'
  *orientation*     'vertical' | 'horizontal'
  *log*             [False|True] False (default) leaves the
                    orientation axis as-is; True sets it to
                    log scale
  ===============   ==========================================

For vertical bars, *align* = 'edge' aligns bars by their left
edges in left, while *align* = 'center' interprets these
values as the *x* coordinates of the bar centers. For
horizontal bars, *align* = 'edge' aligns bars by their bottom
edges in bottom, while *align* = 'center' interprets these
values as the *y* coordinates of the bar centers.

The optional arguments *color*, *edgecolor*, *linewidth*,
*xerr*, and *yerr* can be either scalars or sequences of
length equal to the number of bars.  This enables you to use
bar as the basis for stacked bar charts, or candlestick plots.

Other optional kwargs:

%(Rectangle)s

**Example:** A stacked bar chart.

.. plot:: mpl_examples/pylab_examples/bar_stacked.py


def barh(self, bottom, width, height=<NUM_LIT>, left=None, **kwargs):

patches = self.bar(left=left, height=height, width=width, bottom=bottom,<EOL>orientation='<STR_LIT>', **kwargs)<EOL>return patches<EOL>

call signature::

  barh(bottom, width, height=0.8, left=0, **kwargs)

Make a horizontal bar plot with rectangles bounded by:

  *left*, *left* + *width*, *bottom*, *bottom* + *height*
        (left, right, bottom and top edges)

*bottom*, *width*, *height*, and *left* can be either scalars
or sequences

Return value is a list of
:class:`matplotlib.patches.Rectangle` instances.

Required arguments:

  ========   ======================================================
  Argument   Description
  ========   ======================================================
  *bottom*   the vertical positions of the bottom edges of the bars
  *width*    the lengths of the bars
  ========   ======================================================

Optional keyword arguments:

  ===============   ==========================================
  Keyword           Description
  ===============   ==========================================
  *height*          the heights (thicknesses) of the bars
  *left*            the x coordinates of the left edges of the
                    bars
  *color*           the colors of the bars
  *edgecolor*       the colors of the bar edges
  *linewidth*       width of bar edges; None means use default
                    linewidth; 0 means don't draw edges.
  *xerr*            if not None, will be used to generate
                    errorbars on the bar chart
  *yerr*            if not None, will be used to generate
                    errorbars on the bar chart
  *ecolor*          specifies the color of any errorbar
  *capsize*         (default 3) determines the length in
                    points of the error bar caps
  *align*           'edge' (default) | 'center'
  *log*             [False|True] False (default) leaves the
                    horizontal axis as-is; True sets it to log
                    scale
  ===============   ==========================================

Setting *align* = 'edge' aligns bars by their bottom edges in
bottom, while *align* = 'center' interprets these values as
the *y* coordinates of the bar centers.

The optional arguments *color*, *edgecolor*, *linewidth*,
*xerr*, and *yerr* can be either scalars or sequences of
length equal to the number of bars.  This enables you to use
barh as the basis for stacked bar charts, or candlestick
plots.

other optional kwargs:

%(Rectangle)s


def broken_barh(self, xranges, yrange, **kwargs):

col = mcoll.BrokenBarHCollection(xranges, yrange, **kwargs)<EOL>self.add_collection(col, autolim=True)<EOL>self.autoscale_view()<EOL>return col<EOL>

call signature::

  broken_barh(self, xranges, yrange, **kwargs)

A collection of horizontal bars spanning *yrange* with a sequence of
*xranges*.

Required arguments:

  =========   ==============================
  Argument    Description
  =========   ==============================
  *xranges*   sequence of (*xmin*, *xwidth*)
  *yrange*    sequence of (*ymin*, *ywidth*)
  =========   ==============================

kwargs are
:class:`matplotlib.collections.BrokenBarHCollection`
properties:

%(BrokenBarHCollection)s

these can either be a single argument, ie::

  facecolors = 'black'

or a sequence of arguments for the various bars, ie::

  facecolors = ('black', 'red', 'green')

**Example:**

.. plot:: mpl_examples/pylab_examples/broken_barh.py


def stem(self, x, y, linefmt='<STR_LIT>', markerfmt='<STR_LIT>', basefmt='<STR_LIT>'):

remember_hold=self._hold<EOL>if not self._hold: self.cla()<EOL>self.hold(True)<EOL>markerline, = self.plot(x, y, markerfmt)<EOL>stemlines = []<EOL>for thisx, thisy in zip(x, y):<EOL><INDENT>l, = self.plot([thisx,thisx], [<NUM_LIT:0>, thisy], linefmt)<EOL>stemlines.append(l)<EOL><DEDENT>baseline, = self.plot([np.amin(x), np.amax(x)], [<NUM_LIT:0>,<NUM_LIT:0>], basefmt)<EOL>self.hold(remember_hold)<EOL>return markerline, stemlines, baseline<EOL>

call signature::

  stem(x, y, linefmt='b-', markerfmt='bo', basefmt='r-')

A stem plot plots vertical lines (using *linefmt*) at each *x*
location from the baseline to *y*, and places a marker there
using *markerfmt*.  A horizontal line at 0 is is plotted using
*basefmt*.

Return value is a tuple (*markerline*, *stemlines*,
*baseline*).

.. seealso::
    `this document`__ for details

    :file:`examples/pylab_examples/stem_plot.py`:
        for a demo

__ http://www.mathworks.com/access/helpdesk/help/techdoc/ref/stem.html


def pie(self, x, explode=None, labels=None, colors=None,<EOL>autopct=None, pctdistance=<NUM_LIT>, shadow=False,<EOL>labeldistance=<NUM_LIT>):

self.set_frame_on(False)<EOL>x = np.asarray(x).astype(np.float32)<EOL>sx = float(x.sum())<EOL>if sx><NUM_LIT:1>: x = np.divide(x,sx)<EOL>if labels is None: labels = ['<STR_LIT>']*len(x)<EOL>if explode is None: explode = [<NUM_LIT:0>]*len(x)<EOL>assert(len(x)==len(labels))<EOL>assert(len(x)==len(explode))<EOL>if colors is None: colors = ('<STR_LIT:b>', '<STR_LIT:g>', '<STR_LIT:r>', '<STR_LIT:c>', '<STR_LIT:m>', '<STR_LIT:y>', '<STR_LIT:k>', '<STR_LIT:w>')<EOL>center = <NUM_LIT:0>,<NUM_LIT:0><EOL>radius = <NUM_LIT:1><EOL>theta1 = <NUM_LIT:0><EOL>i = <NUM_LIT:0><EOL>texts = []<EOL>slices = []<EOL>autotexts = []<EOL>for frac, label, expl in cbook.safezip(x,labels, explode):<EOL><INDENT>x, y = center<EOL>theta2 = theta1 + frac<EOL>thetam = <NUM_LIT:2>*math.pi*<NUM_LIT:0.5>*(theta1+theta2)<EOL>x += expl*math.cos(thetam)<EOL>y += expl*math.sin(thetam)<EOL>w = mpatches.Wedge((x,y), radius, <NUM_LIT>*theta1, <NUM_LIT>*theta2,<EOL>facecolor=colors[i%len(colors)])<EOL>slices.append(w)<EOL>self.add_patch(w)<EOL>w.set_label(label)<EOL>if shadow:<EOL><INDENT>shad = mpatches.Shadow(w, -<NUM_LIT>, -<NUM_LIT>,<EOL>)<EOL>shad.set_zorder(<NUM_LIT>*w.get_zorder())<EOL>self.add_patch(shad)<EOL><DEDENT>xt = x + labeldistance*radius*math.cos(thetam)<EOL>yt = y + labeldistance*radius*math.sin(thetam)<EOL>label_alignment = xt > <NUM_LIT:0> and '<STR_LIT:left>' or '<STR_LIT:right>'<EOL>t = self.text(xt, yt, label,<EOL>size=rcParams['<STR_LIT>'],<EOL>horizontalalignment=label_alignment,<EOL>verticalalignment='<STR_LIT>')<EOL>texts.append(t)<EOL>if autopct is not None:<EOL><INDENT>xt = x + pctdistance*radius*math.cos(thetam)<EOL>yt = y + pctdistance*radius*math.sin(thetam)<EOL>if is_string_like(autopct):<EOL><INDENT>s = autopct%(<NUM_LIT>*frac)<EOL><DEDENT>elif callable(autopct):<EOL><INDENT>s = autopct(<NUM_LIT>*frac)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError(<EOL>'<STR_LIT>')<EOL><DEDENT>t = self.text(xt, yt, s,<EOL>horizontalalignment='<STR_LIT>',<EOL>verticalalignment='<STR_LIT>')<EOL>autotexts.append(t)<EOL><DEDENT>theta1 = theta2<EOL>i += <NUM_LIT:1><EOL><DEDENT>self.set_xlim((-<NUM_LIT>, <NUM_LIT>))<EOL>self.set_ylim((-<NUM_LIT>, <NUM_LIT>))<EOL>self.set_xticks([])<EOL>self.set_yticks([])<EOL>if autopct is None: return slices, texts<EOL>else: return slices, texts, autotexts<EOL>

r"""
        call signature::

          pie(x, explode=None, labels=None,
              colors=('b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'),
              autopct=None, pctdistance=0.6, labeldistance=1.1, shadow=False)

        Make a pie chart of array *x*.  The fractional area of each
        wedge is given by x/sum(x).  If sum(x) <= 1, then the values
        of x give the fractional area directly and the array will not
        be normalized.

        Keyword arguments:

          *explode*: [ None | len(x) sequence ]
            If not *None*, is a len(*x*) array which specifies the
            fraction of the radius with which to offset each wedge.

          *colors*: [ None | color sequence ]
            A sequence of matplotlib color args through which the pie chart
            will cycle.

          *labels*: [ None | len(x) sequence of strings ]
            A sequence of strings providing the labels for each wedge

          *autopct*: [ None | format string | format function ]
            If not *None*, is a string or function used to label the
            wedges with their numeric value.  The label will be placed inside
            the wedge.  If it is a format string, the label will be ``fmt%pct``.
            If it is a function, it will be called.

          *pctdistance*: scalar
            The ratio between the center of each pie slice and the
            start of the text generated by *autopct*.  Ignored if
            *autopct* is *None*; default is 0.6.

          *labeldistance*: scalar
            The radial distance at which the pie labels are drawn

          *shadow*: [ False | True ]
            Draw a shadow beneath the pie.

        The pie chart will probably look best if the figure and axes are
        square.  Eg.::

          figure(figsize=(8,8))
          ax = axes([0.1, 0.1, 0.8, 0.8])

        Return value:
          If *autopct* is None, return the tuple (*patches*, *texts*):

            - *patches* is a sequence of
              :class:`matplotlib.patches.Wedge` instances

            - *texts* is a list of the label
              :class:`matplotlib.text.Text` instances.

          If *autopct* is not *None*, return the tuple (*patches*,
          *texts*, *autotexts*), where *patches* and *texts* are as
          above, and *autotexts* is a list of
          :class:`~matplotlib.text.Text` instances for the numeric
          labels.


def errorbar(self, x, y, yerr=None, xerr=None,<EOL>fmt='<STR_LIT:->', ecolor=None, elinewidth=None, capsize=<NUM_LIT:3>,<EOL>barsabove=False, lolims=False, uplims=False,<EOL>xlolims=False, xuplims=False, **kwargs):

self._process_unit_info(xdata=x, ydata=y, kwargs=kwargs)<EOL>if not self._hold: self.cla()<EOL>if not iterable(x):<EOL><INDENT>x = [x]<EOL><DEDENT>if not iterable(y):<EOL><INDENT>y = [y]<EOL><DEDENT>if xerr is not None:<EOL><INDENT>if not iterable(xerr):<EOL><INDENT>xerr = [xerr]*len(x)<EOL><DEDENT><DEDENT>if yerr is not None:<EOL><INDENT>if not iterable(yerr):<EOL><INDENT>yerr = [yerr]*len(y)<EOL><DEDENT><DEDENT>l0 = None<EOL>if barsabove and fmt is not None:<EOL><INDENT>l0, = self.plot(x,y,fmt,**kwargs)<EOL><DEDENT>barcols = []<EOL>caplines = []<EOL>lines_kw = {'<STR_LIT:label>':'<STR_LIT>'}<EOL>if elinewidth:<EOL><INDENT>lines_kw['<STR_LIT>'] = elinewidth<EOL><DEDENT>else:<EOL><INDENT>if '<STR_LIT>' in kwargs:<EOL><INDENT>lines_kw['<STR_LIT>']=kwargs['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in kwargs:<EOL><INDENT>lines_kw['<STR_LIT>']=kwargs['<STR_LIT>']<EOL><DEDENT><DEDENT>if '<STR_LIT>' in kwargs:<EOL><INDENT>lines_kw['<STR_LIT>'] = kwargs['<STR_LIT>']<EOL><DEDENT>if not iterable(lolims):<EOL><INDENT>lolims = np.asarray([lolims]*len(x), bool)<EOL><DEDENT>else: lolims = np.asarray(lolims, bool)<EOL>if not iterable(uplims): uplims = np.array([uplims]*len(x), bool)<EOL>else: uplims = np.asarray(uplims, bool)<EOL>if not iterable(xlolims): xlolims = np.array([xlolims]*len(x), bool)<EOL>else: xlolims = np.asarray(xlolims, bool)<EOL>if not iterable(xuplims): xuplims = np.array([xuplims]*len(x), bool)<EOL>else: xuplims = np.asarray(xuplims, bool)<EOL>def xywhere(xs, ys, mask):<EOL><INDENT>"""<STR_LIT>"""<EOL>assert len(xs)==len(ys)<EOL>assert len(xs)==len(mask)<EOL>xs = [thisx for thisx, b in zip(xs, mask) if b]<EOL>ys = [thisy for thisy, b in zip(ys, mask) if b]<EOL>return xs, ys<EOL><DEDENT>if capsize > <NUM_LIT:0>:<EOL><INDENT>plot_kw = {<EOL>'<STR_LIT>':<NUM_LIT:2>*capsize,<EOL>'<STR_LIT:label>':'<STR_LIT>'}<EOL>if '<STR_LIT>' in kwargs:<EOL><INDENT>plot_kw['<STR_LIT>']=kwargs['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in kwargs:<EOL><INDENT>plot_kw['<STR_LIT>']=kwargs['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in kwargs:<EOL><INDENT>plot_kw['<STR_LIT>'] = kwargs['<STR_LIT>']<EOL><DEDENT><DEDENT>if xerr is not None:<EOL><INDENT>if (iterable(xerr) and len(xerr)==<NUM_LIT:2> and<EOL>iterable(xerr[<NUM_LIT:0>]) and iterable(xerr[<NUM_LIT:1>])):<EOL><INDENT>left  = [thisx-thiserr for (thisx, thiserr)<EOL>in cbook.safezip(x,xerr[<NUM_LIT:0>])]<EOL>right  = [thisx+thiserr for (thisx, thiserr)<EOL>in cbook.safezip(x,xerr[<NUM_LIT:1>])]<EOL><DEDENT>else:<EOL><INDENT>left  = [thisx-thiserr for (thisx, thiserr)<EOL>in cbook.safezip(x,xerr)]<EOL>right  = [thisx+thiserr for (thisx, thiserr)<EOL>in cbook.safezip(x,xerr)]<EOL><DEDENT>barcols.append( self.hlines(y, left, right, **lines_kw ) )<EOL>if capsize > <NUM_LIT:0>:<EOL><INDENT>if xlolims.any():<EOL><INDENT>leftlo, ylo = xywhere(left, y, xlolims)<EOL>caplines.extend(<EOL>self.plot(leftlo, ylo, ls='<STR_LIT:None>',<EOL>marker=mlines.CARETLEFT, **plot_kw) )<EOL>xlolims = ~xlolims<EOL>leftlo, ylo = xywhere(left, y, xlolims)<EOL>caplines.extend( self.plot(leftlo, ylo, '<STR_LIT>', **plot_kw) )<EOL><DEDENT>else:<EOL><INDENT>caplines.extend( self.plot(left, y, '<STR_LIT>', **plot_kw) )<EOL><DEDENT>if xuplims.any():<EOL><INDENT>rightup, yup = xywhere(right, y, xuplims)<EOL>caplines.extend(<EOL>self.plot(rightup,  yup, ls='<STR_LIT:None>',<EOL>marker=mlines.CARETRIGHT, **plot_kw) )<EOL>xuplims = ~xuplims<EOL>rightup, yup = xywhere(right, y, xuplims)<EOL>caplines.extend( self.plot(rightup,  yup, '<STR_LIT>', **plot_kw) )<EOL><DEDENT>else:<EOL><INDENT>caplines.extend( self.plot(right, y, '<STR_LIT>', **plot_kw) )<EOL><DEDENT><DEDENT><DEDENT>if yerr is not None:<EOL><INDENT>if (iterable(yerr) and len(yerr)==<NUM_LIT:2> and<EOL>iterable(yerr[<NUM_LIT:0>]) and iterable(yerr[<NUM_LIT:1>])):<EOL><INDENT>lower  = [thisy-thiserr for (thisy, thiserr)<EOL>in cbook.safezip(y,yerr[<NUM_LIT:0>])]<EOL>upper  = [thisy+thiserr for (thisy, thiserr)<EOL>in cbook.safezip(y,yerr[<NUM_LIT:1>])]<EOL><DEDENT>else:<EOL><INDENT>lower  = [thisy-thiserr for (thisy, thiserr)<EOL>in cbook.safezip(y,yerr)]<EOL>upper  = [thisy+thiserr for (thisy, thiserr)<EOL>in cbook.safezip(y,yerr)]<EOL><DEDENT>barcols.append( self.vlines(x, lower, upper, **lines_kw) )<EOL>if capsize > <NUM_LIT:0>:<EOL><INDENT>if lolims.any():<EOL><INDENT>xlo, lowerlo = xywhere(x, lower, lolims)<EOL>caplines.extend(<EOL>self.plot(xlo, lowerlo, ls='<STR_LIT:None>',<EOL>marker=mlines.CARETDOWN, **plot_kw) )<EOL>lolims = ~lolims<EOL>xlo, lowerlo = xywhere(x, lower, lolims)<EOL>caplines.extend( self.plot(xlo, lowerlo, '<STR_LIT>', **plot_kw) )<EOL><DEDENT>else:<EOL><INDENT>caplines.extend( self.plot(x, lower, '<STR_LIT>', **plot_kw) )<EOL><DEDENT>if uplims.any():<EOL><INDENT>xup, upperup = xywhere(x, upper, uplims)<EOL>caplines.extend(<EOL>self.plot(xup, upperup, ls='<STR_LIT:None>',<EOL>marker=mlines.CARETUP, **plot_kw) )<EOL>uplims = ~uplims<EOL>xup, upperup = xywhere(x, upper, uplims)<EOL>caplines.extend( self.plot(xup, upperup, '<STR_LIT>', **plot_kw) )<EOL><DEDENT>else:<EOL><INDENT>caplines.extend( self.plot(x, upper, '<STR_LIT>', **plot_kw) )<EOL><DEDENT><DEDENT><DEDENT>if not barsabove and fmt is not None:<EOL><INDENT>l0, = self.plot(x,y,fmt,**kwargs)<EOL><DEDENT>if ecolor is None:<EOL><INDENT>if l0 is None:<EOL><INDENT>ecolor = self._get_lines._get_next_cycle_color()<EOL><DEDENT>else:<EOL><INDENT>ecolor = l0.get_color()<EOL><DEDENT><DEDENT>for l in barcols:<EOL><INDENT>l.set_color(ecolor)<EOL><DEDENT>for l in caplines:<EOL><INDENT>l.set_color(ecolor)<EOL><DEDENT>self.autoscale_view()<EOL>return (l0, caplines, barcols)<EOL>

call signature::

  errorbar(x, y, yerr=None, xerr=None,
           fmt='-', ecolor=None, elinewidth=None, capsize=3,
           barsabove=False, lolims=False, uplims=False,
           xlolims=False, xuplims=False)

Plot *x* versus *y* with error deltas in *yerr* and *xerr*.
Vertical errorbars are plotted if *yerr* is not *None*.
Horizontal errorbars are plotted if *xerr* is not *None*.

*x*, *y*, *xerr*, and *yerr* can all be scalars, which plots a
single error bar at *x*, *y*.

Optional keyword arguments:

  *xerr*/*yerr*: [ scalar | N, Nx1, Nx2 array-like ]
    If a scalar number, len(N) array-like object, or an Nx1 array-like
    object, errorbars are drawn +/- value.

    If a rank-1, Nx2 Numpy array, errorbars are drawn at -column1 and
    +column2

  *fmt*: '-'
    The plot format symbol for *y*. If *fmt* is *None*, just plot the
    errorbars with no line symbols.  This can be useful for creating a
    bar plot with errorbars.

  *ecolor*: [ None | mpl color ]
    a matplotlib color arg which gives the color the errorbar lines; if
    *None*, use the marker color.

  *elinewidth*: scalar
    the linewidth of the errorbar lines. If *None*, use the linewidth.

  *capsize*: scalar
    the size of the error bar caps in points

  *barsabove*: [ True | False ]
    if *True*, will plot the errorbars above the plot
    symbols. Default is below.

  *lolims*/*uplims*/*xlolims*/*xuplims*: [ False | True ]
    These arguments can be used to indicate that a value gives
    only upper/lower limits. In that case a caret symbol is
    used to indicate this. lims-arguments may be of the same
    type as *xerr* and *yerr*.

All other keyword arguments are passed on to the plot command for the
markers, so you can add additional key=value pairs to control the
errorbar markers.  For example, this code makes big red squares with
thick green edges::

  x,y,yerr = rand(3,10)
  errorbar(x, y, yerr, marker='s',
           mfc='red', mec='green', ms=20, mew=4)

where *mfc*, *mec*, *ms* and *mew* are aliases for the longer
property names, *markerfacecolor*, *markeredgecolor*, *markersize*
and *markeredgewith*.

valid kwargs for the marker properties are

%(Line2D)s

Return value is a length 3 tuple.  The first element is the
:class:`~matplotlib.lines.Line2D` instance for the *y* symbol
lines.  The second element is a list of error bar cap lines,
the third element is a list of
:class:`~matplotlib.collections.LineCollection` instances for
the horizontal and vertical error ranges.

**Example:**

.. plot:: mpl_examples/pylab_examples/errorbar_demo.py


def boxplot(self, x, notch=<NUM_LIT:0>, sym='<STR_LIT>', vert=<NUM_LIT:1>, whis=<NUM_LIT>,<EOL>positions=None, widths=None):

if not self._hold: self.cla()<EOL>holdStatus = self._hold<EOL>whiskers, caps, boxes, medians, fliers = [], [], [], [], []<EOL>if hasattr(x, '<STR_LIT>'):<EOL><INDENT>if len(x.shape) == <NUM_LIT:1>:<EOL><INDENT>if hasattr(x[<NUM_LIT:0>], '<STR_LIT>'):<EOL><INDENT>x = list(x)<EOL><DEDENT>else:<EOL><INDENT>x = [x,]<EOL><DEDENT><DEDENT>elif len(x.shape) == <NUM_LIT:2>:<EOL><INDENT>nr, nc = x.shape<EOL>if nr == <NUM_LIT:1>:<EOL><INDENT>x = [x]<EOL><DEDENT>elif nc == <NUM_LIT:1>:<EOL><INDENT>x = [x.ravel()]<EOL><DEDENT>else:<EOL><INDENT>x = [x[:,i] for i in range(nc)]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>if not hasattr(x[<NUM_LIT:0>], '<STR_LIT>'):<EOL><INDENT>x = [x]<EOL><DEDENT>col = len(x)<EOL>if positions is None:<EOL><INDENT>positions = list(range(<NUM_LIT:1>, col + <NUM_LIT:1>))<EOL><DEDENT>if widths is None:<EOL><INDENT>distance = max(positions) - min(positions)<EOL>widths = min(<NUM_LIT>*max(distance,<NUM_LIT:1.0>), <NUM_LIT:0.5>)<EOL><DEDENT>if isinstance(widths, float) or isinstance(widths, int):<EOL><INDENT>widths = np.ones((col,), float) * widths<EOL><DEDENT>self.hold(True)<EOL>for i,pos in enumerate(positions):<EOL><INDENT>d = np.ravel(x[i])<EOL>row = len(d)<EOL>q1, med, q3 = mlab.prctile(d,[<NUM_LIT>,<NUM_LIT:50>,<NUM_LIT>])<EOL>iq = q3 - q1<EOL>hi_val = q3 + whis*iq<EOL>wisk_hi = np.compress( d <= hi_val , d )<EOL>if len(wisk_hi) == <NUM_LIT:0>:<EOL><INDENT>wisk_hi = q3<EOL><DEDENT>else:<EOL><INDENT>wisk_hi = max(wisk_hi)<EOL><DEDENT>lo_val = q1 - whis*iq<EOL>wisk_lo = np.compress( d >= lo_val, d )<EOL>if len(wisk_lo) == <NUM_LIT:0>:<EOL><INDENT>wisk_lo = q1<EOL><DEDENT>else:<EOL><INDENT>wisk_lo = min(wisk_lo)<EOL><DEDENT>flier_hi = []<EOL>flier_lo = []<EOL>flier_hi_x = []<EOL>flier_lo_x = []<EOL>if len(sym) != <NUM_LIT:0>:<EOL><INDENT>flier_hi = np.compress( d > wisk_hi, d )<EOL>flier_lo = np.compress( d < wisk_lo, d )<EOL>flier_hi_x = np.ones(flier_hi.shape[<NUM_LIT:0>]) * pos<EOL>flier_lo_x = np.ones(flier_lo.shape[<NUM_LIT:0>]) * pos<EOL><DEDENT>box_x_min = pos - widths[i] * <NUM_LIT:0.5><EOL>box_x_max = pos + widths[i] * <NUM_LIT:0.5><EOL>wisk_x = np.ones(<NUM_LIT:2>) * pos<EOL>cap_x_min = pos - widths[i] * <NUM_LIT><EOL>cap_x_max = pos + widths[i] * <NUM_LIT><EOL>cap_x = [cap_x_min, cap_x_max]<EOL>med_y = [med, med]<EOL>if notch == <NUM_LIT:0>:<EOL><INDENT>box_x = [box_x_min, box_x_max, box_x_max, box_x_min, box_x_min ]<EOL>box_y = [q1, q1, q3, q3, q1 ]<EOL>med_x = [box_x_min, box_x_max]<EOL><DEDENT>else:<EOL><INDENT>notch_max = med + <NUM_LIT>*iq/np.sqrt(row)<EOL>notch_min = med - <NUM_LIT>*iq/np.sqrt(row)<EOL>if notch_max > q3:<EOL><INDENT>notch_max = q3<EOL><DEDENT>if notch_min < q1:<EOL><INDENT>notch_min = q1<EOL><DEDENT>box_x = [box_x_min, box_x_max, box_x_max, cap_x_max, box_x_max,<EOL>box_x_max, box_x_min, box_x_min, cap_x_min, box_x_min,<EOL>box_x_min ]<EOL>box_y = [q1, q1, notch_min, med, notch_max, q3, q3, notch_max,<EOL>med, notch_min, q1]<EOL>med_x = [cap_x_min, cap_x_max]<EOL>med_y = [med, med]<EOL><DEDENT>if vert:<EOL><INDENT>def doplot(*args):<EOL><INDENT>return self.plot(*args)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>def doplot(*args):<EOL><INDENT>shuffled = []<EOL>for i in range(<NUM_LIT:0>, len(args), <NUM_LIT:3>):<EOL><INDENT>shuffled.extend([args[i+<NUM_LIT:1>], args[i], args[i+<NUM_LIT:2>]])<EOL><DEDENT>return self.plot(*shuffled)<EOL><DEDENT><DEDENT>whiskers.extend(doplot(wisk_x, [q1, wisk_lo], '<STR_LIT>',<EOL>wisk_x, [q3, wisk_hi], '<STR_LIT>'))<EOL>caps.extend(doplot(cap_x, [wisk_hi, wisk_hi], '<STR_LIT>',<EOL>cap_x, [wisk_lo, wisk_lo], '<STR_LIT>'))<EOL>boxes.extend(doplot(box_x, box_y, '<STR_LIT>'))<EOL>medians.extend(doplot(med_x, med_y, '<STR_LIT>'))<EOL>fliers.extend(doplot(flier_hi_x, flier_hi, sym,<EOL>flier_lo_x, flier_lo, sym))<EOL><DEDENT>if <NUM_LIT:1> == vert:<EOL><INDENT>setticks, setlim = self.set_xticks, self.set_xlim<EOL><DEDENT>else:<EOL><INDENT>setticks, setlim = self.set_yticks, self.set_ylim<EOL><DEDENT>newlimits = min(positions)-<NUM_LIT:0.5>, max(positions)+<NUM_LIT:0.5><EOL>setlim(newlimits)<EOL>setticks(positions)<EOL>self.hold(holdStatus)<EOL>return dict(whiskers=whiskers, caps=caps, boxes=boxes,<EOL>medians=medians, fliers=fliers)<EOL>

call signature::

  boxplot(x, notch=0, sym='+', vert=1, whis=1.5,
          positions=None, widths=None)

Make a box and whisker plot for each column of *x* or each
vector in sequence *x*.  The box extends from the lower to
upper quartile values of the data, with a line at the median.
The whiskers extend from the box to show the range of the
data.  Flier points are those past the end of the whiskers.

- *notch* = 0 (default) produces a rectangular box plot.
- *notch* = 1 will produce a notched box plot

*sym* (default 'b+') is the default symbol for flier points.
Enter an empty string ('') if you don't want to show fliers.

- *vert* = 1 (default) makes the boxes vertical.
- *vert* = 0 makes horizontal boxes.  This seems goofy, but
  that's how Matlab did it.

*whis* (default 1.5) defines the length of the whiskers as
a function of the inner quartile range.  They extend to the
most extreme data point within ( ``whis*(75%-25%)`` ) data range.

*positions* (default 1,2,...,n) sets the horizontal positions of
the boxes. The ticks and limits are automatically set to match
the positions.

*widths* is either a scalar or a vector and sets the width of
each box. The default is 0.5, or ``0.15*(distance between extreme
positions)`` if that is smaller.

*x* is an array or a sequence of vectors.

Returns a dictionary mapping each component of the boxplot
to a list of the :class:`matplotlib.lines.Line2D`
instances created.

**Example:**

.. plot:: pyplots/boxplot_demo.py


def scatter(self, x, y, s=<NUM_LIT:20>, c='<STR_LIT:b>', marker='<STR_LIT:o>', cmap=None, norm=None,<EOL>vmin=None, vmax=None, alpha=<NUM_LIT:1.0>, linewidths=None,<EOL>faceted=True, verts=None,<EOL>**kwargs):

if not self._hold: self.cla()<EOL>syms =  { <EOL>'<STR_LIT:s>' : (<NUM_LIT:4>,math.pi/<NUM_LIT>,<NUM_LIT:0>),   <EOL>'<STR_LIT:o>' : (<NUM_LIT:20>,<NUM_LIT:3>,<NUM_LIT:0>),            <EOL>'<STR_LIT>' : (<NUM_LIT:3>,<NUM_LIT:0>,<NUM_LIT:0>),             <EOL>'<STR_LIT:>>' : (<NUM_LIT:3>,math.pi/<NUM_LIT>,<NUM_LIT:0>),   <EOL>'<STR_LIT:v>' : (<NUM_LIT:3>,math.pi,<NUM_LIT:0>),       <EOL>'<STR_LIT:<>' : (<NUM_LIT:3>,<NUM_LIT:3>*math.pi/<NUM_LIT>,<NUM_LIT:0>), <EOL>'<STR_LIT:d>' : (<NUM_LIT:4>,<NUM_LIT:0>,<NUM_LIT:0>),             <EOL>'<STR_LIT:p>' : (<NUM_LIT:5>,<NUM_LIT:0>,<NUM_LIT:0>),             <EOL>'<STR_LIT:h>' : (<NUM_LIT:6>,<NUM_LIT:0>,<NUM_LIT:0>),             <EOL>'<STR_LIT>' : (<NUM_LIT:8>,<NUM_LIT:0>,<NUM_LIT:0>),             <EOL>'<STR_LIT:+>' : (<NUM_LIT:4>,<NUM_LIT:0>,<NUM_LIT:2>),             <EOL>'<STR_LIT:x>' : (<NUM_LIT:4>,math.pi/<NUM_LIT>,<NUM_LIT:2>)    <EOL>}<EOL>self._process_unit_info(xdata=x, ydata=y, kwargs=kwargs)<EOL>x, y, s, c = cbook.delete_masked_points(x, y, s, c)<EOL>if is_string_like(c) or cbook.is_sequence_of_strings(c):<EOL><INDENT>colors = mcolors.colorConverter.to_rgba_array(c, alpha)<EOL><DEDENT>else:<EOL><INDENT>sh = np.shape(c)<EOL>if len(sh) == <NUM_LIT:1> and sh[<NUM_LIT:0>] == len(x):<EOL><INDENT>colors = None  <EOL><DEDENT>else:<EOL><INDENT>colors = mcolors.colorConverter.to_rgba_array(c, alpha)<EOL><DEDENT><DEDENT>if not iterable(s):<EOL><INDENT>scales = (s,)<EOL><DEDENT>else:<EOL><INDENT>scales = s<EOL><DEDENT>if faceted:<EOL><INDENT>edgecolors = None<EOL><DEDENT>else:<EOL><INDENT>edgecolors = '<STR_LIT:none>'<EOL>warnings.warn(<EOL>'''<STR_LIT>''',<EOL>DeprecationWarning)   <EOL><DEDENT>sym = None<EOL>symstyle = <NUM_LIT:0><EOL>if marker is None and not (verts is None):<EOL><INDENT>marker = (verts, <NUM_LIT:0>)<EOL>verts = None<EOL><DEDENT>if is_string_like(marker):<EOL><INDENT>sym = syms.get(marker)<EOL>if sym is None and verts is None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>numsides, rotation, symstyle = syms[marker]<EOL><DEDENT>elif iterable(marker):<EOL><INDENT>if len(marker)<<NUM_LIT:2> or len(marker)><NUM_LIT:3>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if cbook.is_numlike(marker[<NUM_LIT:0>]):<EOL><INDENT>if len(marker)==<NUM_LIT:2>:<EOL><INDENT>numsides, rotation = marker[<NUM_LIT:0>], <NUM_LIT:0.><EOL><DEDENT>elif len(marker)==<NUM_LIT:3>:<EOL><INDENT>numsides, rotation = marker[<NUM_LIT:0>], marker[<NUM_LIT:2>]<EOL><DEDENT>sym = True<EOL>if marker[<NUM_LIT:1>] in (<NUM_LIT:1>,<NUM_LIT:2>):<EOL><INDENT>symstyle = marker[<NUM_LIT:1>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>verts = np.asarray(marker[<NUM_LIT:0>])<EOL><DEDENT><DEDENT>if sym is not None:<EOL><INDENT>if symstyle==<NUM_LIT:0>:<EOL><INDENT>collection = mcoll.RegularPolyCollection(<EOL>numsides, rotation, scales,<EOL>facecolors = colors,<EOL>edgecolors = edgecolors,<EOL>linewidths = linewidths,<EOL>offsets = list(zip(x,y)),<EOL>transOffset = self.transData,<EOL>)<EOL><DEDENT>elif symstyle==<NUM_LIT:1>:<EOL><INDENT>collection = mcoll.StarPolygonCollection(<EOL>numsides, rotation, scales,<EOL>facecolors = colors,<EOL>edgecolors = edgecolors,<EOL>linewidths = linewidths,<EOL>offsets = list(zip(x,y)),<EOL>transOffset = self.transData,<EOL>)<EOL><DEDENT>elif symstyle==<NUM_LIT:2>:<EOL><INDENT>collection = mcoll.AsteriskPolygonCollection(<EOL>numsides, rotation, scales,<EOL>facecolors = colors,<EOL>edgecolors = edgecolors,<EOL>linewidths = linewidths,<EOL>offsets = list(zip(x,y)),<EOL>transOffset = self.transData,<EOL>)<EOL><DEDENT>elif symstyle==<NUM_LIT:3>:<EOL><INDENT>collection = mcoll.CircleCollection(<EOL>scales,<EOL>facecolors = colors,<EOL>edgecolors = edgecolors,<EOL>linewidths = linewidths,<EOL>offsets = list(zip(x,y)),<EOL>transOffset = self.transData,<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>rescale = np.sqrt(max(verts[:,<NUM_LIT:0>]**<NUM_LIT:2>+verts[:,<NUM_LIT:1>]**<NUM_LIT:2>))<EOL>verts /= rescale<EOL>collection = mcoll.PolyCollection(<EOL>(verts,), scales,<EOL>facecolors = colors,<EOL>edgecolors = edgecolors,<EOL>linewidths = linewidths,<EOL>offsets = list(zip(x,y)),<EOL>transOffset = self.transData,<EOL>)<EOL>collection.set_transform(mtransforms.IdentityTransform())<EOL><DEDENT>collection.set_alpha(alpha)<EOL>collection.update(kwargs)<EOL>if colors is None:<EOL><INDENT>if norm is not None: assert(isinstance(norm, mcolors.Normalize))<EOL>if cmap is not None: assert(isinstance(cmap, mcolors.Colormap))<EOL>collection.set_array(np.asarray(c))<EOL>collection.set_cmap(cmap)<EOL>collection.set_norm(norm)<EOL>if vmin is not None or vmax is not None:<EOL><INDENT>collection.set_clim(vmin, vmax)<EOL><DEDENT>else:<EOL><INDENT>collection.autoscale_None()<EOL><DEDENT><DEDENT>temp_x = x<EOL>temp_y = y<EOL>minx = np.amin(temp_x)<EOL>maxx = np.amax(temp_x)<EOL>miny = np.amin(temp_y)<EOL>maxy = np.amax(temp_y)<EOL>w = maxx-minx<EOL>h = maxy-miny<EOL>padx, pady = <NUM_LIT>*w, <NUM_LIT>*h<EOL>corners = (minx-padx, miny-pady), (maxx+padx, maxy+pady)<EOL>self.update_datalim( corners)<EOL>self.autoscale_view()<EOL>self.add_collection(collection)<EOL>return collection<EOL>

call signatures::

  scatter(x, y, s=20, c='b', marker='o', cmap=None, norm=None,
          vmin=None, vmax=None, alpha=1.0, linewidths=None,
          verts=None, **kwargs)

Make a scatter plot of *x* versus *y*, where *x*, *y* are 1-D
sequences of the same length, *N*.

Keyword arguments:

  *s*:
    size in points^2.  It is a scalar or an array of the same
    length as *x* and *y*.

  *c*:
    a color. *c* can be a single color format string, or a
    sequence of color specifications of length *N*, or a
    sequence of *N* numbers to be mapped to colors using the
    *cmap* and *norm* specified via kwargs (see below). Note
    that *c* should not be a single numeric RGB or RGBA
    sequence because that is indistinguishable from an array
    of values to be colormapped.  *c* can be a 2-D array in
    which the rows are RGB or RGBA, however.

  *marker*:
    can be one of:

    =====   ==============
    Value   Description
    =====   ==============
    's'     square
    'o'     circle
    '^'     triangle up
    '>'     triangle right
    'v'     triangle down
    '<'     triangle left
    'd'     diamond
    'p'     pentagram
    'h'     hexagon
    '8'     octagon
    '+'     plus
    'x'     cross
    =====   ==============

    The marker can also be a tuple (*numsides*, *style*,
    *angle*), which will create a custom, regular symbol.

      *numsides*:
        the number of sides

      *style*:
        the style of the regular symbol:

        =====   =============================================
        Value   Description
        =====   =============================================
        0       a regular polygon
        1       a star-like symbol
        2       an asterisk
        3       a circle (*numsides* and *angle* is ignored)
        =====   =============================================

      *angle*:
        the angle of rotation of the symbol

    Finally, *marker* can be (*verts*, 0): *verts* is a
    sequence of (*x*, *y*) vertices for a custom scatter
    symbol.  Alternatively, use the kwarg combination
    *marker* = *None*, *verts* = *verts*.

Any or all of *x*, *y*, *s*, and *c* may be masked arrays, in
which case all masks will be combined and only unmasked points
will be plotted.

Other keyword arguments: the color mapping and normalization
arguments will be used only if *c* is an array of floats.

  *cmap*: [ None | Colormap ]
    A :class:`matplotlib.colors.Colormap` instance. If *None*,
    defaults to rc ``image.cmap``. *cmap* is only used if *c*
    is an array of floats.

  *norm*: [ None | Normalize ]
    A :class:`matplotlib.colors.Normalize` instance is used to
    scale luminance data to 0, 1. If *None*, use the default
    :func:`normalize`. *norm* is only used if *c* is an array
    of floats.

  *vmin*/*vmax*:
    *vmin* and *vmax* are used in conjunction with norm to
    normalize luminance data.  If either are None, the min and
    max of the color array *C* is used.  Note if you pass a
    *norm* instance, your settings for *vmin* and *vmax* will
    be ignored.

  *alpha*: 0 <= scalar <= 1
    The alpha value for the patches

  *linewidths*: [ None | scalar | sequence ]
    If *None*, defaults to (lines.linewidth,).  Note that this
    is a tuple, and if you set the linewidths argument you
    must set it as a sequence of floats, as required by
    :class:`~matplotlib.collections.RegularPolyCollection`.

Optional kwargs control the
:class:`~matplotlib.collections.Collection` properties; in
particular:

  *edgecolors*:
    'none' to plot faces with no outlines

  *facecolors*:
    'none' to plot unfilled outlines

Here are the standard descriptions of all the
:class:`~matplotlib.collections.Collection` kwargs:

%(Collection)s

A :class:`~matplotlib.collections.Collection` instance is
returned.


def hexbin(self, x, y, C = None, gridsize = <NUM_LIT:100>, bins = None,<EOL>xscale = '<STR_LIT>', yscale = '<STR_LIT>',<EOL>cmap=None, norm=None, vmin=None, vmax=None,<EOL>alpha=<NUM_LIT:1.0>, linewidths=None, edgecolors='<STR_LIT:none>',<EOL>reduce_C_function = np.mean,<EOL>**kwargs):

if not self._hold: self.cla()<EOL>self._process_unit_info(xdata=x, ydata=y, kwargs=kwargs)<EOL>x, y, C = cbook.delete_masked_points(x, y, C)<EOL>if iterable(gridsize):<EOL><INDENT>nx, ny = gridsize<EOL><DEDENT>else:<EOL><INDENT>nx = gridsize<EOL>ny = int(nx/math.sqrt(<NUM_LIT:3>))<EOL><DEDENT>x = np.array(x, float)<EOL>y = np.array(y, float)<EOL>if xscale=='<STR_LIT>':<EOL><INDENT>x = np.log10(x)<EOL><DEDENT>if yscale=='<STR_LIT>':<EOL><INDENT>y = np.log10(y)<EOL><DEDENT>xmin = np.amin(x)<EOL>xmax = np.amax(x)<EOL>ymin = np.amin(y)<EOL>ymax = np.amax(y)<EOL>padding = <NUM_LIT> * (xmax - xmin)<EOL>xmin -= padding<EOL>xmax += padding<EOL>sx = (xmax-xmin) / nx<EOL>sy = (ymax-ymin) / ny<EOL>x = (x-xmin)/sx<EOL>y = (y-ymin)/sy<EOL>ix1 = np.round(x).astype(int)<EOL>iy1 = np.round(y).astype(int)<EOL>ix2 = np.floor(x).astype(int)<EOL>iy2 = np.floor(y).astype(int)<EOL>nx1 = nx + <NUM_LIT:1><EOL>ny1 = ny + <NUM_LIT:1><EOL>nx2 = nx<EOL>ny2 = ny<EOL>n = nx1*ny1+nx2*ny2<EOL>d1 = (x-ix1)**<NUM_LIT:2> + <NUM_LIT> * (y-iy1)**<NUM_LIT:2><EOL>d2 = (x-ix2-<NUM_LIT:0.5>)**<NUM_LIT:2> + <NUM_LIT> * (y-iy2-<NUM_LIT:0.5>)**<NUM_LIT:2><EOL>bdist = (d1<d2)<EOL>if C is None:<EOL><INDENT>accum = np.zeros(n)<EOL>lattice1 = accum[:nx1*ny1]<EOL>lattice2 = accum[nx1*ny1:]<EOL>lattice1.shape = (nx1,ny1)<EOL>lattice2.shape = (nx2,ny2)<EOL>for i in range(len(x)):<EOL><INDENT>if bdist[i]:<EOL><INDENT>lattice1[ix1[i], iy1[i]]+=<NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>lattice2[ix2[i], iy2[i]]+=<NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>lattice1 = np.empty((nx1,ny1),dtype=object)<EOL>for i in range(nx1):<EOL><INDENT>for j in range(ny1):<EOL><INDENT>lattice1[i,j] = []<EOL><DEDENT><DEDENT>lattice2 = np.empty((nx2,ny2),dtype=object)<EOL>for i in range(nx2):<EOL><INDENT>for j in range(ny2):<EOL><INDENT>lattice2[i,j] = []<EOL><DEDENT><DEDENT>for i in range(len(x)):<EOL><INDENT>if bdist[i]:<EOL><INDENT>lattice1[ix1[i], iy1[i]].append( C[i] )<EOL><DEDENT>else:<EOL><INDENT>lattice2[ix2[i], iy2[i]].append( C[i] )<EOL><DEDENT><DEDENT>for i in range(nx1):<EOL><INDENT>for j in range(ny1):<EOL><INDENT>vals = lattice1[i,j]<EOL>if len(vals):<EOL><INDENT>lattice1[i,j] = reduce_C_function( vals )<EOL><DEDENT>else:<EOL><INDENT>lattice1[i,j] = np.nan<EOL><DEDENT><DEDENT><DEDENT>for i in range(nx2):<EOL><INDENT>for j in range(ny2):<EOL><INDENT>vals = lattice2[i,j]<EOL>if len(vals):<EOL><INDENT>lattice2[i,j] = reduce_C_function( vals )<EOL><DEDENT>else:<EOL><INDENT>lattice2[i,j] = np.nan<EOL><DEDENT><DEDENT><DEDENT>accum = np.hstack((<EOL>lattice1.astype(float).ravel(), lattice2.astype(float).ravel()))<EOL>good_idxs = ~np.isnan(accum)<EOL><DEDENT>px = xmin + sx * np.array([ <NUM_LIT:0.5>, <NUM_LIT:0.5>, <NUM_LIT:0.0>, -<NUM_LIT:0.5>, -<NUM_LIT:0.5>,  <NUM_LIT:0.0>])<EOL>py = ymin + sy * np.array([-<NUM_LIT:0.5>, <NUM_LIT:0.5>, <NUM_LIT:1.0>,  <NUM_LIT:0.5>, -<NUM_LIT:0.5>, -<NUM_LIT:1.0>]) / <NUM_LIT><EOL>polygons = np.zeros((<NUM_LIT:6>, n, <NUM_LIT:2>), float)<EOL>polygons[:,:nx1*ny1,<NUM_LIT:0>] = np.repeat(np.arange(nx1), ny1)<EOL>polygons[:,:nx1*ny1,<NUM_LIT:1>] = np.tile(np.arange(ny1), nx1)<EOL>polygons[:,nx1*ny1:,<NUM_LIT:0>] = np.repeat(np.arange(nx2) + <NUM_LIT:0.5>, ny2)<EOL>polygons[:,nx1*ny1:,<NUM_LIT:1>] = np.tile(np.arange(ny2), nx2) + <NUM_LIT:0.5><EOL>if C is not None:<EOL><INDENT>polygons = polygons[:,good_idxs,:]<EOL>accum = accum[good_idxs]<EOL><DEDENT>polygons = np.transpose(polygons, axes=[<NUM_LIT:1>,<NUM_LIT:0>,<NUM_LIT:2>])<EOL>polygons[:,:,<NUM_LIT:0>] *= sx<EOL>polygons[:,:,<NUM_LIT:1>] *= sy<EOL>polygons[:,:,<NUM_LIT:0>] += px<EOL>polygons[:,:,<NUM_LIT:1>] += py<EOL>if xscale=='<STR_LIT>':<EOL><INDENT>polygons[:,:,<NUM_LIT:0>] = <NUM_LIT:10>**(polygons[:,:,<NUM_LIT:0>])<EOL>xmin = <NUM_LIT:10>**xmin<EOL>xmax = <NUM_LIT:10>**xmax<EOL>self.set_xscale('<STR_LIT>')<EOL><DEDENT>if yscale=='<STR_LIT>':<EOL><INDENT>polygons[:,:,<NUM_LIT:1>] = <NUM_LIT:10>**(polygons[:,:,<NUM_LIT:1>])<EOL>ymin = <NUM_LIT:10>**ymin<EOL>ymax = <NUM_LIT:10>**ymax<EOL>self.set_yscale('<STR_LIT>')<EOL><DEDENT>if edgecolors=='<STR_LIT:none>':<EOL><INDENT>edgecolors = '<STR_LIT>'<EOL><DEDENT>collection = mcoll.PolyCollection(<EOL>polygons,<EOL>edgecolors = edgecolors,<EOL>linewidths = linewidths,<EOL>transOffset = self.transData,<EOL>)<EOL>if bins=='<STR_LIT>':<EOL><INDENT>accum = np.log10(accum+<NUM_LIT:1>)<EOL><DEDENT>elif bins!=None:<EOL><INDENT>if not iterable(bins):<EOL><INDENT>minimum, maximum = min(accum), max(accum)<EOL>bins-=<NUM_LIT:1> <EOL>bins = minimum + (maximum-minimum)*np.arange(bins)/bins<EOL><DEDENT>bins = np.sort(bins)<EOL>accum = bins.searchsorted(accum)<EOL><DEDENT>if norm is not None: assert(isinstance(norm, mcolors.Normalize))<EOL>if cmap is not None: assert(isinstance(cmap, mcolors.Colormap))<EOL>collection.set_array(accum)<EOL>collection.set_cmap(cmap)<EOL>collection.set_norm(norm)<EOL>collection.set_alpha(alpha)<EOL>collection.update(kwargs)<EOL>if vmin is not None or vmax is not None:<EOL><INDENT>collection.set_clim(vmin, vmax)<EOL><DEDENT>else:<EOL><INDENT>collection.autoscale_None()<EOL><DEDENT>corners = ((xmin, ymin), (xmax, ymax))<EOL>self.update_datalim( corners)<EOL>self.autoscale_view()<EOL>self.add_collection(collection)<EOL>return collection<EOL>

call signature::

  hexbin(x, y, C = None, gridsize = 100, bins = None,
         xscale = 'linear', yscale = 'linear',
         cmap=None, norm=None, vmin=None, vmax=None,
         alpha=1.0, linewidths=None, edgecolors='none'
         reduce_C_function = np.mean,
         **kwargs)

Make a hexagonal binning plot of *x* versus *y*, where *x*,
*y* are 1-D sequences of the same length, *N*. If *C* is None
(the default), this is a histogram of the number of occurences
of the observations at (x[i],y[i]).

If *C* is specified, it specifies values at the coordinate
(x[i],y[i]). These values are accumulated for each hexagonal
bin and then reduced according to *reduce_C_function*, which
defaults to numpy's mean function (np.mean). (If *C* is
specified, it must also be a 1-D sequence of the same length
as *x* and *y*.)

*x*, *y* and/or *C* may be masked arrays, in which case only
unmasked points will be plotted.

Optional keyword arguments:

  *gridsize*: [ 100 | integer ]
    The number of hexagons in the *x*-direction, default is
    100. The corresponding number of hexagons in the
    *y*-direction is chosen such that the hexagons are
    approximately regular. Alternatively, gridsize can be a
    tuple with two elements specifying the number of hexagons
    in the *x*-direction and the *y*-direction.

  *bins*: [ None | 'log' | integer | sequence ]
    If *None*, no binning is applied; the color of each hexagon
    directly corresponds to its count value.

    If 'log', use a logarithmic scale for the color
    map. Internally, :math:`log_{10}(i+1)` is used to
    determine the hexagon color.

    If an integer, divide the counts in the specified number
    of bins, and color the hexagons accordingly.

    If a sequence of values, the values of the lower bound of
    the bins to be used.

  *xscale*: [ 'linear' | 'log' ]
    Use a linear or log10 scale on the horizontal axis.

  *scale*: [ 'linear' | 'log' ]
    Use a linear or log10 scale on the vertical axis.

Other keyword arguments controlling color mapping and normalization
arguments:

  *cmap*: [ None | Colormap ]
    a :class:`matplotlib.cm.Colormap` instance. If *None*,
    defaults to rc ``image.cmap``.

  *norm*: [ None | Normalize ]
    :class:`matplotlib.colors.Normalize` instance is used to
    scale luminance data to 0,1.

  *vmin*/*vmax*: scalar
    *vmin* and *vmax* are used in conjunction with *norm* to normalize
    luminance data.  If either are *None*, the min and max of the color
    array *C* is used.  Note if you pass a norm instance, your settings
    for *vmin* and *vmax* will be ignored.

  *alpha*: scalar
    the alpha value for the patches

  *linewidths*: [ None | scalar ]
    If *None*, defaults to rc lines.linewidth. Note that this
    is a tuple, and if you set the linewidths argument you
    must set it as a sequence of floats, as required by
    :class:`~matplotlib.collections.RegularPolyCollection`.

Other keyword arguments controlling the Collection properties:

  *edgecolors*: [ None | mpl color | color sequence ]
    If 'none', draws the edges in the same color as the fill color.
    This is the default, as it avoids unsightly unpainted pixels
    between the hexagons.

    If *None*, draws the outlines in the default color.

    If a matplotlib color arg or sequence of rgba tuples, draws the
    outlines in the specified color.

Here are the standard descriptions of all the
:class:`~matplotlib.collections.Collection` kwargs:

%(Collection)s

The return value is a
:class:`~matplotlib.collections.PolyCollection` instance; use
:meth:`~matplotlib.collection.PolyCollection.get_array` on
this :class:`~matplotlib.collections.PolyCollection` to get
the counts in each hexagon.

**Example:**

.. plot:: mpl_examples/pylab_examples/hexbin_demo.py


def arrow(self, x, y, dx, dy, **kwargs):

a = mpatches.FancyArrow(x, y, dx, dy, **kwargs)<EOL>self.add_artist(a)<EOL>return a<EOL>

call signature::

   arrow(x, y, dx, dy, **kwargs)

Draws arrow on specified axis from (*x*, *y*) to (*x* + *dx*,
*y* + *dy*).

Optional kwargs control the arrow properties:
%(FancyArrow)s

**Example:**

.. plot:: mpl_examples/pylab_examples/arrow_demo.py


if not self._hold: self.cla()<EOL>b = mquiver.Barbs(self, *args, **kw)<EOL>self.add_collection(b)<EOL>self.update_datalim(b.get_offsets())<EOL>self.autoscale_view()<EOL>return b<EOL>

%(barbs_doc)s
**Example:**

.. plot:: mpl_examples/pylab_examples/barb_demo.py


if not self._hold: self.cla()<EOL>patches = []<EOL>for poly in self._get_patches_for_fill(*args, **kwargs):<EOL><INDENT>self.add_patch( poly )<EOL>patches.append( poly )<EOL><DEDENT>self.autoscale_view()<EOL>return patches<EOL>

call signature::

  fill(*args, **kwargs)

Plot filled polygons.  *args* is a variable length argument,
allowing for multiple *x*, *y* pairs with an optional color
format string; see :func:`~matplotlib.pyplot.plot` for details
on the argument parsing.  For example, to plot a polygon with
vertices at *x*, *y* in blue.::

  ax.fill(x,y, 'b' )

An arbitrary number of *x*, *y*, *color* groups can be specified::

  ax.fill(x1, y1, 'g', x2, y2, 'r')

Return value is a list of :class:`~matplotlib.patches.Patch`
instances that were added.

The same color strings that :func:`~matplotlib.pyplot.plot`
supports are supported by the fill format string.

If you would like to fill below a curve, eg. shade a region
between 0 and *y* along *x*, use :meth:`fill_between`

The *closed* kwarg will close the polygon when *True* (default).

kwargs control the Polygon properties:

%(Polygon)s

**Example:**

.. plot:: mpl_examples/pylab_examples/fill_demo.py


def fill_between(self, x, y1, y2=<NUM_LIT:0>, where=None, **kwargs):

<EOL>self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs)<EOL>self._process_unit_info(ydata=y2)<EOL>x = np.asarray(self.convert_xunits(x))<EOL>y1 = np.asarray(self.convert_yunits(y1))<EOL>y2 = np.asarray(self.convert_yunits(y2))<EOL>if not cbook.iterable(y1):<EOL><INDENT>y1 = np.ones_like(x)*y1<EOL><DEDENT>if not cbook.iterable(y2):<EOL><INDENT>y2 = np.ones_like(x)*y2<EOL><DEDENT>if where is None:<EOL><INDENT>where = np.ones(len(x), np.bool)<EOL><DEDENT>where = np.asarray(where)<EOL>assert( (len(x)==len(y1)) and (len(x)==len(y2)) and len(x)==len(where))<EOL>polys = []<EOL>for ind0, ind1 in mlab.contiguous_regions(where):<EOL><INDENT>theseverts = []<EOL>xslice = x[ind0:ind1]<EOL>y1slice = y1[ind0:ind1]<EOL>y2slice = y2[ind0:ind1]<EOL>if not len(xslice):<EOL><INDENT>continue<EOL><DEDENT>N = len(xslice)<EOL>X = np.zeros((<NUM_LIT:2>*N+<NUM_LIT:2>, <NUM_LIT:2>), np.float)<EOL>X[<NUM_LIT:0>] = xslice[<NUM_LIT:0>], y2slice[<NUM_LIT:0>]<EOL>X[N+<NUM_LIT:1>] = xslice[-<NUM_LIT:1>], y2slice[-<NUM_LIT:1>]<EOL>X[<NUM_LIT:1>:N+<NUM_LIT:1>,<NUM_LIT:0>] = xslice<EOL>X[<NUM_LIT:1>:N+<NUM_LIT:1>,<NUM_LIT:1>] = y1slice<EOL>X[N+<NUM_LIT:2>:,<NUM_LIT:0>] = xslice[::-<NUM_LIT:1>]<EOL>X[N+<NUM_LIT:2>:,<NUM_LIT:1>] = y2slice[::-<NUM_LIT:1>]<EOL>polys.append(X)<EOL><DEDENT>collection = mcoll.PolyCollection(polys, **kwargs)<EOL>XY1 = np.array([x[where], y1[where]]).T<EOL>XY2 = np.array([x[where], y2[where]]).T<EOL>self.dataLim.update_from_data_xy(XY1, self.ignore_existing_data_limits,<EOL>updatex=True, updatey=True)<EOL>self.dataLim.update_from_data_xy(XY2, self.ignore_existing_data_limits,<EOL>updatex=False, updatey=True)<EOL>self.add_collection(collection)<EOL>self.autoscale_view()<EOL>return collection<EOL>

call signature::

  fill_between(x, y1, y2=0, where=None, **kwargs)

Create a :class:`~matplotlib.collections.PolyCollection`
filling the regions between *y1* and *y2* where
``where==True``

*x*
  an N length np array of the x data

*y1*
  an N length scalar or np array of the x data

*y2*
  an N length scalar or np array of the x data

*where*
   if None, default to fill between everywhere.  If not None,
   it is a a N length numpy boolean array and the fill will
   only happen over the regions where ``where==True``

*kwargs*
  keyword args passed on to the :class:`PolyCollection`

kwargs control the Polygon properties:

%(PolyCollection)s

.. plot:: mpl_examples/pylab_examples/fill_between.py


def imshow(self, X, cmap=None, norm=None, aspect=None,<EOL>interpolation=None, alpha=<NUM_LIT:1.0>, vmin=None, vmax=None,<EOL>origin=None, extent=None, shape=None, filternorm=<NUM_LIT:1>,<EOL>filterrad=<NUM_LIT>, imlim=None, resample=None, url=None, **kwargs):

if not self._hold: self.cla()<EOL>if norm is not None: assert(isinstance(norm, mcolors.Normalize))<EOL>if cmap is not None: assert(isinstance(cmap, mcolors.Colormap))<EOL>if aspect is None: aspect = rcParams['<STR_LIT>']<EOL>self.set_aspect(aspect)<EOL>im = mimage.AxesImage(self, cmap, norm, interpolation, origin, extent,<EOL>filternorm=filternorm,<EOL>filterrad=filterrad, resample=resample, **kwargs)<EOL>im.set_data(X)<EOL>im.set_alpha(alpha)<EOL>self._set_artist_props(im)<EOL>im.set_clip_path(self.patch)<EOL>if vmin is not None or vmax is not None:<EOL><INDENT>im.set_clim(vmin, vmax)<EOL><DEDENT>else:<EOL><INDENT>im.autoscale_None()<EOL><DEDENT>im.set_url(url)<EOL>xmin, xmax, ymin, ymax = im.get_extent()<EOL>corners = (xmin, ymin), (xmax, ymax)<EOL>self.update_datalim(corners)<EOL>if self._autoscaleon:<EOL><INDENT>self.set_xlim((xmin, xmax))<EOL>self.set_ylim((ymin, ymax))<EOL><DEDENT>self.images.append(im)<EOL>return im<EOL>

call signature::

  imshow(X, cmap=None, norm=None, aspect=None, interpolation=None,
         alpha=1.0, vmin=None, vmax=None, origin=None, extent=None,
         **kwargs)

Display the image in *X* to current axes.  *X* may be a float
array, a uint8 array or a PIL image. If *X* is an array, *X*
can have the following shapes:

* MxN -- luminance (grayscale, float array only)
* MxNx3 -- RGB (float or uint8 array)
* MxNx4 -- RGBA (float or uint8 array)

The value for each component of MxNx3 and MxNx4 float arrays should be
in the range 0.0 to 1.0; MxN float arrays may be normalised.

An :class:`matplotlib.image.AxesImage` instance is returned.

Keyword arguments:

  *cmap*: [ None | Colormap ]
    A :class:`matplotlib.cm.Colormap` instance, eg. cm.jet.
    If *None*, default to rc ``image.cmap`` value.

    *cmap* is ignored when *X* has RGB(A) information

  *aspect*: [ None | 'auto' | 'equal' | scalar ]
    If 'auto', changes the image aspect ratio to match that of the axes

    If 'equal', and *extent* is *None*, changes the axes
    aspect ratio to match that of the image. If *extent* is
    not *None*, the axes aspect ratio is changed to match that
    of the extent.

    If *None*, default to rc ``image.aspect`` value.

  *interpolation*:

    Acceptable values are *None*, 'nearest', 'bilinear',
      'bicubic', 'spline16', 'spline36', 'hanning', 'hamming',
      'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian',
      'bessel', 'mitchell', 'sinc', 'lanczos',

    If *interpolation* is *None*, default to rc
    ``image.interpolation``. See also the *filternorm* and
    *filterrad* parameters

  *norm*: [ None | Normalize ]
    An :class:`matplotlib.colors.Normalize` instance; if
    *None*, default is ``normalization()``.  This scales
    luminance -> 0-1

    *norm* is only used for an MxN float array.

  *vmin*/*vmax*: [ None | scalar ]
    Used to scale a luminance image to 0-1.  If either is
    *None*, the min and max of the luminance values will be
    used.  Note if *norm* is not *None*, the settings for
    *vmin* and *vmax* will be ignored.

  *alpha*: scalar
    The alpha blending value, between 0 (transparent) and 1 (opaque)

  *origin*: [ None | 'upper' | 'lower' ]
    Place the [0,0] index of the array in the upper left or lower left
    corner of the axes. If *None*, default to rc ``image.origin``.

  *extent*: [ None | scalars (left, right, bottom, top) ]
    Eata values of the axes.  The default assigns zero-based row,
    column indices to the *x*, *y* centers of the pixels.

  *shape*: [ None | scalars (columns, rows) ]
    For raw buffer images

  *filternorm*:
    A parameter for the antigrain image resize filter.  From the
    antigrain documentation, if *filternorm* = 1, the filter normalizes
    integer values and corrects the rounding errors. It doesn't do
    anything with the source floating point values, it corrects only
    integers according to the rule of 1.0 which means that any sum of
    pixel weights must be equal to 1.0.  So, the filter function must
    produce a graph of the proper shape.

  *filterrad*:
    The filter radius for filters that have a radius
    parameter, i.e. when interpolation is one of: 'sinc',
    'lanczos' or 'blackman'

Additional kwargs are :class:`~matplotlib.artist.Artist` properties:

%(Artist)s

**Example:**

.. plot:: mpl_examples/pylab_examples/image_demo.py