try:<EOL><INDENT>dashd = backend_bases.GraphicsContextBase.dashd<EOL>if cbook.is_string_like(ls):<EOL><INDENT>if ls in dashd:<EOL><INDENT>dashes = [dashd[ls]]<EOL><DEDENT>elif ls in cbook.ls_mapper:<EOL><INDENT>dashes = [dashd[cbook.ls_mapper[ls]]]<EOL><DEDENT>else:<EOL><INDENT>raise ValueError()<EOL><DEDENT><DEDENT>elif cbook.iterable(ls):<EOL><INDENT>try:<EOL><INDENT>dashes = []<EOL>for x in ls:<EOL><INDENT>if cbook.is_string_like(x):<EOL><INDENT>if x in dashd:<EOL><INDENT>dashes.append(dashd[x])<EOL><DEDENT>elif x in cbook.ls_mapper:<EOL><INDENT>dashes.append(dashd[cbook.ls_mapper[x]])<EOL><DEDENT>else:<EOL><INDENT>raise ValueError()<EOL><DEDENT><DEDENT>elif cbook.iterable(x) and len(x) == <NUM_LIT:2>:<EOL><INDENT>dashes.append(x)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError()<EOL><DEDENT><DEDENT><DEDENT>except ValueError:<EOL><INDENT>if len(ls) == <NUM_LIT:2>:<EOL><INDENT>dashes = ls<EOL><DEDENT>else:<EOL><INDENT>raise ValueError()<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError()<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>raise ValueError('<STR_LIT>' % ls)<EOL><DEDENT>self._linestyles = dashes<EOL>

Set the linestyle(s) for the collection.

ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' |
(offset, on-off-dash-seq) ]


return self.set_linestyle(ls)<EOL>


if aa is None:<EOL><INDENT>aa = mpl.rcParams['<STR_LIT>']<EOL><DEDENT>self._antialiaseds = self._get_bool(aa)<EOL>

Set the antialiasing state for rendering.

ACCEPTS: Boolean or sequence of booleans


return self.set_antialiased(aa)<EOL>


self.set_facecolor(c)<EOL>self.set_edgecolor(c)<EOL>

Set both the edgecolor and the facecolor.

ACCEPTS: matplotlib color arg or sequence of rgba tuples

.. seealso::
    :meth:`set_facecolor`, :meth:`set_edgecolor`


if c is None:<EOL><INDENT>c = mpl.rcParams['<STR_LIT>']<EOL><DEDENT>self._facecolors_original = c<EOL>self._facecolors = _colors.colorConverter.to_rgba_array(c, self._alpha)<EOL>

Set the facecolor(s) of the collection.  *c* can be a
matplotlib color arg (all patches have same color), or a
sequence or rgba tuples; if it is a sequence the patches will
cycle through the sequence

ACCEPTS: matplotlib color arg or sequence of rgba tuples


return self.set_facecolor(c)<EOL>


if c == '<STR_LIT>':<EOL><INDENT>self._edgecolors = '<STR_LIT>'<EOL>self._edgecolors_original = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>if c is None:<EOL><INDENT>c = mpl.rcParams['<STR_LIT>']<EOL><DEDENT>self._edgecolors_original = c<EOL>self._edgecolors = _colors.colorConverter.to_rgba_array(<EOL>c, self._alpha)<EOL><DEDENT>

Set the edgecolor(s) of the collection. *c* can be a
matplotlib color arg (all patches have same color), or a
sequence or rgba tuples; if it is a sequence the patches will
cycle through the sequence.

If *c* is 'face', the edge color will always be the same as
the face color.

ACCEPTS: matplotlib color arg or sequence of rgba tuples


return self.set_edgecolor(c)<EOL>


try:<EOL><INDENT>float(alpha)<EOL><DEDENT>except TypeError:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>artist.Artist.set_alpha(self, alpha)<EOL>try:<EOL><INDENT>self._facecolors = _colors.colorConverter.to_rgba_array(<EOL>self._facecolors_original, self._alpha)<EOL><DEDENT>except (AttributeError, TypeError, IndexError):<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>if self._edgecolors_original != '<STR_LIT>':<EOL><INDENT>self._edgecolors = _colors.colorConverter.to_rgba_array(<EOL>self._edgecolors_original, self._alpha)<EOL><DEDENT><DEDENT>except (AttributeError, TypeError, IndexError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>

Set the alpha tranparencies of the collection.  *alpha* must be
a float.

ACCEPTS: float


if self._A is None:<EOL><INDENT>return<EOL><DEDENT>if self._A.ndim > <NUM_LIT:1>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if len(self._facecolors):<EOL><INDENT>self._facecolors = self.to_rgba(self._A, self._alpha)<EOL><DEDENT>else:<EOL><INDENT>self._edgecolors = self.to_rgba(self._A, self._alpha)<EOL><DEDENT>

If the scalar mappable array is not none, update colors
from scalar data


artist.Artist.update_from(self, other)<EOL>self._antialiaseds = other._antialiaseds<EOL>self._edgecolors_original = other._edgecolors_original<EOL>self._edgecolors = other._edgecolors<EOL>self._facecolors_original = other._facecolors_original<EOL>self._facecolors = other._facecolors<EOL>self._linewidths = other._linewidths<EOL>self._linestyles = other._linestyles<EOL>self._pickradius = other._pickradius<EOL>


def convert_mesh_to_paths(meshWidth, meshHeight, coordinates):

Path = mpath.Path<EOL>if ma.isMaskedArray(coordinates):<EOL><INDENT>c = coordinates.data<EOL><DEDENT>else:<EOL><INDENT>c = coordinates<EOL><DEDENT>points = np.concatenate((<EOL>c[<NUM_LIT:0>:-<NUM_LIT:1>, <NUM_LIT:0>:-<NUM_LIT:1>],<EOL>c[<NUM_LIT:0>:-<NUM_LIT:1>, <NUM_LIT:1>:],<EOL>c[<NUM_LIT:1>:, <NUM_LIT:1>:],<EOL>c[<NUM_LIT:1>:, <NUM_LIT:0>:-<NUM_LIT:1>],<EOL>c[<NUM_LIT:0>:-<NUM_LIT:1>, <NUM_LIT:0>:-<NUM_LIT:1>]<EOL>), axis=<NUM_LIT:2>)<EOL>points = points.reshape((meshWidth * meshHeight, <NUM_LIT:5>, <NUM_LIT:2>))<EOL>return [Path(x) for x in points]<EOL>

Converts a given mesh into a sequence of
:class:`matplotlib.path.Path` objects for easier rendering by
backends that do not directly support quadmeshes.

This function is primarily of use to backend implementers.


def __init__(self, verts, sizes=None, closed=True, **kwargs):

Collection.__init__(self, **kwargs)<EOL>self._sizes = sizes<EOL>self.set_verts(verts, closed)<EOL>

*verts* is a sequence of ( *verts0*, *verts1*, ...) where
*verts_i* is a sequence of *xy* tuples of vertices, or an
equivalent :mod:`numpy` array of shape (*nv*, 2).

*sizes* is *None* (default) or a sequence of floats that
scale the corresponding *verts_i*.  The scaling is applied
before the Artist master transform; if the latter is an identity
transform, then the overall scaling is such that if
*verts_i* specify a unit square, then *sizes_i* is the area
of that square in points^2.
If len(*sizes*) < *nv*, the additional values will be
taken cyclically from the array.

*closed*, when *True*, will explicitly close the polygon.

%(Collection)s


def set_verts(self, verts, closed=True):

if closed:<EOL><INDENT>self._paths = []<EOL>for xy in verts:<EOL><INDENT>if np.ma.isMaskedArray(xy):<EOL><INDENT>if len(xy) and (xy[<NUM_LIT:0>] != xy[-<NUM_LIT:1>]).any():<EOL><INDENT>xy = np.ma.concatenate([xy, [xy[<NUM_LIT:0>]]])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>xy = np.asarray(xy)<EOL>if len(xy) and (xy[<NUM_LIT:0>] != xy[-<NUM_LIT:1>]).any():<EOL><INDENT>xy = np.concatenate([xy, [xy[<NUM_LIT:0>]]])<EOL><DEDENT><DEDENT>self._paths.append(mpath.Path(xy))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._paths = [mpath.Path(xy) for xy in verts]<EOL><DEDENT>

This allows one to delay initialization of the vertices.


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

ymin, ywidth = yrange<EOL>ymax = ymin + ywidth<EOL>verts = [[(xmin, ymin), (xmin, ymax), (xmin+xwidth, ymax),<EOL>(xmin+xwidth, ymin), (xmin, ymin)] for xmin, xwidth in xranges]<EOL>PolyCollection.__init__(self, verts, **kwargs)<EOL>

*xranges*
    sequence of (*xmin*, *xwidth*)

*yrange*
    *ymin*, *ywidth*

%(Collection)s


@staticmethod<EOL><INDENT>def span_where(x, ymin, ymax, where, **kwargs):<DEDENT>

xranges = []<EOL>for ind0, ind1 in mlab.contiguous_regions(where):<EOL><INDENT>xslice = x[ind0:ind1]<EOL>if not len(xslice):<EOL><INDENT>continue<EOL><DEDENT>xranges.append((xslice[<NUM_LIT:0>], xslice[-<NUM_LIT:1>]-xslice[<NUM_LIT:0>]))<EOL><DEDENT>collection = BrokenBarHCollection(xranges, [ymin, ymax-ymin], **kwargs)<EOL>return collection<EOL>

Create a BrokenBarHCollection to plot horizontal bars from
over the regions in *x* where *where* is True.  The bars range
on the y-axis from *ymin* to *ymax*

A :class:`BrokenBarHCollection` is returned.
*kwargs* are passed on to the collection


Collection.__init__(self, **kwargs)<EOL>self._sizes = sizes<EOL>self._numsides = numsides<EOL>self._paths = [self._path_generator(numsides)]<EOL>self._rotation = rotation<EOL>self.set_transform(transforms.IdentityTransform())<EOL>

*numsides*
    the number of sides of the polygon

*rotation*
    the rotation of the polygon in radians

*sizes*
    gives the area of the circle circumscribing the
    regular polygon in points^2

%(Collection)s

Example: see :file:`examples/dynamic_collection.py` for
complete example::

    offsets = np.random.rand(20,2)
    facecolors = [cm.jet(x) for x in np.random.rand(20)]
    black = (0,0,0,1)

    collection = RegularPolyCollection(
        numsides=5, # a pentagon
        rotation=0, sizes=(50,),
        facecolors = facecolors,
        edgecolors = (black,),
        linewidths = (1,),
        offsets = offsets,
        transOffset = ax.transData,
        )


def __init__(self, segments,     <EOL>linewidths=None,<EOL>colors=None,<EOL>antialiaseds=None,<EOL>linestyles='<STR_LIT>',<EOL>offsets=None,<EOL>transOffset=None,<EOL>norm=None,<EOL>cmap=None,<EOL>pickradius=<NUM_LIT:5>,<EOL>**kwargs<EOL>):

if colors is None:<EOL><INDENT>colors = mpl.rcParams['<STR_LIT>']<EOL><DEDENT>if linewidths is None:<EOL><INDENT>linewidths = (mpl.rcParams['<STR_LIT>'],)<EOL><DEDENT>if antialiaseds is None:<EOL><INDENT>antialiaseds = (mpl.rcParams['<STR_LIT>'],)<EOL><DEDENT>self.set_linestyles(linestyles)<EOL>colors = _colors.colorConverter.to_rgba_array(colors)<EOL>Collection.__init__(<EOL>self,<EOL>edgecolors=colors,<EOL>linewidths=linewidths,<EOL>linestyles=linestyles,<EOL>antialiaseds=antialiaseds,<EOL>offsets=offsets,<EOL>transOffset=transOffset,<EOL>norm=norm,<EOL>cmap=cmap,<EOL>pickradius=pickradius,<EOL>**kwargs)<EOL>self.set_facecolors([])<EOL>self.set_segments(segments)<EOL>

*segments*
    a sequence of (*line0*, *line1*, *line2*), where::

        linen = (x0, y0), (x1, y1), ... (xm, ym)

    or the equivalent numpy array with two columns. Each line
    can be a different length.

*colors*
    must be a sequence of RGBA tuples (eg arbitrary color
    strings, etc, not allowed).

*antialiaseds*
    must be a sequence of ones or zeros

*linestyles* [ 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
    a string or dash tuple. The dash tuple is::

        (offset, onoffseq),

    where *onoffseq* is an even length tuple of on and off ink
    in points.

If *linewidths*, *colors*, or *antialiaseds* is None, they
default to their rcParams setting, in sequence form.

If *offsets* and *transOffset* are not None, then
*offsets* are transformed by *transOffset* and applied after
the segments have been transformed to display coordinates.

If *offsets* is not None but *transOffset* is None, then the
*offsets* are added to the segments before any transformation.
In this case, a single offset can be specified as::

    offsets=(xo,yo)

and this value will be added cumulatively to each successive
segment, so as to produce a set of successively offset curves.

*norm*
    None (optional for :class:`matplotlib.cm.ScalarMappable`)
*cmap*
    None (optional for :class:`matplotlib.cm.ScalarMappable`)

*pickradius* is the tolerance for mouse clicks picking a line.
The default is 5 pt.

The use of :class:`~matplotlib.cm.ScalarMappable` is optional.
If the :class:`~matplotlib.cm.ScalarMappable` matrix
:attr:`~matplotlib.cm.ScalarMappable._A` is not None (ie a call to
:meth:`~matplotlib.cm.ScalarMappable.set_array` has been made), at
draw time a call to scalar mappable will be made to set the colors.


self._edgecolors = _colors.colorConverter.to_rgba_array(c)<EOL>

Set the color(s) of the line collection.  *c* can be a
matplotlib color arg (all patches have same color), or a
sequence or rgba tuples; if it is a sequence the patches will
cycle through the sequence

ACCEPTS: matplotlib color arg or sequence of rgba tuples


warnings.warn('<STR_LIT>')<EOL>return self.set_color(c)<EOL>


Collection.__init__(self, **kwargs)<EOL>self._sizes = sizes<EOL>self.set_transform(transforms.IdentityTransform())<EOL>self._paths = [mpath.Path.unit_circle()]<EOL>

*sizes*
    Gives the area of the circle in points^2

%(Collection)s


def __init__(self, widths, heights, angles, units='<STR_LIT>', **kwargs):

Collection.__init__(self, **kwargs)<EOL>self._widths = np.asarray(widths).ravel()<EOL>self._heights = np.asarray(heights).ravel()<EOL>self._angles = np.asarray(angles).ravel() * (np.pi/<NUM_LIT>)<EOL>self._units = units<EOL>self.set_transform(transforms.IdentityTransform())<EOL>self._transforms = []<EOL>self._paths = [mpath.Path.unit_circle()]<EOL>self._initialized = False<EOL>

*widths*: sequence
    half-lengths of first axes (e.g., semi-major axis lengths)

*heights*: sequence
    half-lengths of second axes

*angles*: sequence
    angles of first axes, degrees CCW from the X-axis

*units*: ['points' | 'inches' | 'dots' | 'width' | 'height' | 'x' | 'y']
    units in which majors and minors are given; 'width' and 'height'
    refer to the dimensions of the axes, while 'x' and 'y'
    refer to the *offsets* data units.

Additional kwargs inherited from the base :class:`Collection`:

%(Collection)s


def __init__(self, patches, match_original=False, **kwargs):

if match_original:<EOL><INDENT>def determine_facecolor(patch):<EOL><INDENT>if patch.fill:<EOL><INDENT>return patch.get_facecolor()<EOL><DEDENT>return [<NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>]<EOL><DEDENT>facecolors = [determine_facecolor(p) for p in patches]<EOL>edgecolors = [p.get_edgecolor() for p in patches]<EOL>linewidths = [p.get_linewidths() for p in patches]<EOL>antialiaseds = [p.get_antialiased() for p in patches]<EOL>Collection.__init__(<EOL>self,<EOL>edgecolors=edgecolors,<EOL>facecolors=facecolors,<EOL>linewidths=linewidths,<EOL>linestyles='<STR_LIT>',<EOL>antialiaseds=antialiaseds)<EOL><DEDENT>else:<EOL><INDENT>Collection.__init__(self, **kwargs)<EOL><DEDENT>paths = [p.get_transform().transform_path(p.get_path())<EOL>for p in patches]<EOL>self._paths = paths<EOL>

*patches*
    a sequence of Patch objects.  This list may include
    a heterogeneous assortment of different patch types.

*match_original*
    If True, use the colors and linewidths of the original
    patches.  If False, new colors may be assigned by
    providing the standard collection arguments, facecolor,
    edgecolor, linewidths, norm or cmap.

If any of *edgecolors*, *facecolors*, *linewidths*,
*antialiaseds* are None, they default to their
:data:`matplotlib.rcParams` patch setting, in sequence form.

The use of :class:`~matplotlib.cm.ScalarMappable` is optional.
If the :class:`~matplotlib.cm.ScalarMappable` matrix _A is not
None (ie a call to set_array has been made), at draw time a
call to scalar mappable will be made to set the face colors.


<EOL>if len(x) < <NUM_LIT:2>:<EOL><INDENT>res, = np.nonzero( (cx - x)**<NUM_LIT:2> + (cy - y)**<NUM_LIT:2> <= radius**<NUM_LIT:2> )<EOL>return res<EOL><DEDENT>xr,yr = x[:-<NUM_LIT:1>],y[:-<NUM_LIT:1>]<EOL>dx,dy = x[<NUM_LIT:1>:]-xr, y[<NUM_LIT:1>:]-yr<EOL>Lnorm_sq = dx**<NUM_LIT:2>+dy**<NUM_LIT:2>    <EOL>u = ( (cx-xr)*dx + (cy-yr)*dy )/Lnorm_sq<EOL>candidates = (u>=<NUM_LIT:0>) & (u<=<NUM_LIT:1>)<EOL>point_hits = (cx - x)**<NUM_LIT:2> + (cy - y)**<NUM_LIT:2> <= radius**<NUM_LIT:2><EOL>candidates = candidates & ~(point_hits[:-<NUM_LIT:1>] | point_hits[<NUM_LIT:1>:])<EOL>px,py = xr+u*dx,yr+u*dy<EOL>line_hits = (cx-px)**<NUM_LIT:2> + (cy-py)**<NUM_LIT:2> <= radius**<NUM_LIT:2><EOL>line_hits = line_hits & candidates<EOL>points, = point_hits.ravel().nonzero()<EOL>lines, = line_hits.ravel().nonzero()<EOL>return np.concatenate((points,lines))<EOL>

Determine if any line segments are within radius of a
point. Returns the list of line segments that are within that
radius.


def __init__(self, xdata, ydata,<EOL>linewidth       = None, <EOL>linestyle       = None,<EOL>color           = None,<EOL>marker          = None,<EOL>markersize      = None,<EOL>markeredgewidth = None,<EOL>markeredgecolor = None,<EOL>markerfacecolor = None,<EOL>antialiased     = None,<EOL>dash_capstyle   = None,<EOL>solid_capstyle  = None,<EOL>dash_joinstyle  = None,<EOL>solid_joinstyle = None,<EOL>pickradius      = <NUM_LIT:5>,<EOL>drawstyle       = None,<EOL>**kwargs<EOL>):

Artist.__init__(self)<EOL>if not iterable(xdata):<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>if not iterable(ydata):<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>if linewidth is None   : linewidth=rcParams['<STR_LIT>']<EOL>if linestyle is None   : linestyle=rcParams['<STR_LIT>']<EOL>if marker is None      : marker=rcParams['<STR_LIT>']<EOL>if color is None       : color=rcParams['<STR_LIT>']<EOL>if markersize is None  : markersize=rcParams['<STR_LIT>']<EOL>if antialiased is None : antialiased=rcParams['<STR_LIT>']<EOL>if dash_capstyle is None : dash_capstyle=rcParams['<STR_LIT>']<EOL>if dash_joinstyle is None : dash_joinstyle=rcParams['<STR_LIT>']<EOL>if solid_capstyle is None : solid_capstyle=rcParams['<STR_LIT>']<EOL>if solid_joinstyle is None : solid_joinstyle=rcParams['<STR_LIT>']<EOL>if drawstyle is None : drawstyle='<STR_LIT:default>'<EOL>self.set_dash_capstyle(dash_capstyle)<EOL>self.set_dash_joinstyle(dash_joinstyle)<EOL>self.set_solid_capstyle(solid_capstyle)<EOL>self.set_solid_joinstyle(solid_joinstyle)<EOL>self.set_linestyle(linestyle)<EOL>self.set_drawstyle(drawstyle)<EOL>self.set_linewidth(linewidth)<EOL>self.set_color(color)<EOL>self.set_marker(marker)<EOL>self.set_antialiased(antialiased)<EOL>self.set_markersize(markersize)<EOL>self._dashSeq = None<EOL>self.set_markerfacecolor(markerfacecolor)<EOL>self.set_markeredgecolor(markeredgecolor)<EOL>self.set_markeredgewidth(markeredgewidth)<EOL>self._point_size_reduction = <NUM_LIT:0.5><EOL>self.verticalOffset = None<EOL>self.update(kwargs)<EOL>self.pickradius = pickradius<EOL>if is_numlike(self._picker):<EOL><INDENT>self.pickradius = self._picker<EOL><DEDENT>self._xorig = np.asarray([])<EOL>self._yorig = np.asarray([])<EOL>self._invalid = True<EOL>self.set_data(xdata, ydata)<EOL>

Create a :class:`~matplotlib.lines.Line2D` instance with *x*
and *y* data in sequences *xdata*, *ydata*.

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

%(Line2D)s

See :meth:`set_linestyle` for a decription of the line styles,
:meth:`set_marker` for a description of the markers, and
:meth:`set_drawstyle` for a description of the draw styles.


if callable(self._contains): return self._contains(self,mouseevent)<EOL>if not is_numlike(self.pickradius):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if self._invalid:<EOL><INDENT>self.recache()<EOL><DEDENT>if len(self._xy)==<NUM_LIT:0>: return False,{}<EOL>path, affine = self._transformed_path.get_transformed_path_and_affine()<EOL>path = affine.transform_path(path)<EOL>xy = path.vertices<EOL>xt = xy[:, <NUM_LIT:0>]<EOL>yt = xy[:, <NUM_LIT:1>]<EOL>if self.figure == None:<EOL><INDENT>warning.warn('<STR_LIT>')<EOL>pixels = self.pickradius<EOL><DEDENT>else:<EOL><INDENT>pixels = self.figure.dpi/<NUM_LIT> * self.pickradius<EOL><DEDENT>if self._linestyle in ['<STR_LIT:None>',None]:<EOL><INDENT>d = (xt-mouseevent.x)**<NUM_LIT:2> + (yt-mouseevent.y)**<NUM_LIT:2><EOL>ind, = np.nonzero(np.less_equal(d, pixels**<NUM_LIT:2>))<EOL><DEDENT>else:<EOL><INDENT>ind = segment_hits(mouseevent.x,mouseevent.y,xt,yt,pixels)<EOL><DEDENT>if False and self._label != '<STR_LIT>':<EOL><INDENT>print("<STR_LIT>",self._label,"<STR_LIT>",mouseevent.x,mouseevent.y)<EOL>print('<STR_LIT>', xt)<EOL>print('<STR_LIT>', yt)<EOL>print('<STR_LIT>',ind)<EOL><DEDENT>return len(ind)><NUM_LIT:0>,dict(ind=ind)<EOL>

Test whether the mouse event occurred on the line.  The pick
radius determines the precision of the location test (usually
within five points of the value).  Use
:meth:`~matplotlib.lines.Line2D.get_pickradius` or
:meth:`~matplotlib.lines.Line2D.set_pickradius` to view or
modify it.

Returns *True* if any values are within the radius along with
``{'ind': pointlist}``, where *pointlist* is the set of points
within the radius.

TODO: sort returned indices by distance


return self.pickradius<EOL>

return the pick radius used for containment tests


self.pickradius = d<EOL>

Sets the pick radius used for containment tests

        ACCEPTS: float distance in points


if callable(p):<EOL><INDENT>self._contains = p<EOL><DEDENT>else:<EOL><INDENT>self.pickradius = p<EOL><DEDENT>self._picker = p<EOL>

Sets the event picker details for the line.

        ACCEPTS: float distance in points or callable pick function
        ``fn(artist, event)``


if len(args)==<NUM_LIT:1>:<EOL><INDENT>x, y = args[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>x, y = args<EOL><DEDENT>not_masked = <NUM_LIT:0><EOL>if not ma.isMaskedArray(x):<EOL><INDENT>x = np.asarray(x)<EOL>not_masked += <NUM_LIT:1><EOL><DEDENT>if not ma.isMaskedArray(y):<EOL><INDENT>y = np.asarray(y)<EOL>not_masked += <NUM_LIT:1><EOL><DEDENT>if (not_masked < <NUM_LIT:2> or<EOL>(x is not self._xorig and<EOL>(x.shape != self._xorig.shape or np.any(x != self._xorig))) or<EOL>(y is not self._yorig and<EOL>(y.shape != self._yorig.shape or np.any(y != self._yorig)))):<EOL><INDENT>self._xorig = x<EOL>self._yorig = y<EOL>self._invalid = True<EOL><DEDENT>


Artist.set_transform(self, t)<EOL>self._invalid = True<EOL>

set the Transformation instance used by this artist

ACCEPTS: a :class:`matplotlib.transforms.Transform` instance


if len(x)<<NUM_LIT:2>: return <NUM_LIT:1><EOL>return np.alltrue(x[<NUM_LIT:1>:]-x[<NUM_LIT:0>:-<NUM_LIT:1>]>=<NUM_LIT:0>)<EOL>


return self.get_xdata(orig=orig), self.get_ydata(orig=orig)<EOL>

Return the xdata, ydata.

If *orig* is *True*, return the original data


if orig:<EOL><INDENT>return self._xorig<EOL><DEDENT>if self._invalid:<EOL><INDENT>self.recache()<EOL><DEDENT>return self._x<EOL>

Return the xdata.

If *orig* is *True*, return the original data, else the
processed data.


if orig:<EOL><INDENT>return self._yorig<EOL><DEDENT>if self._invalid:<EOL><INDENT>self.recache()<EOL><DEDENT>return self._y<EOL>

Return the ydata.

If *orig* is *True*, return the original data, else the
processed data.


if self._invalid:<EOL><INDENT>self.recache()<EOL><DEDENT>return self._path<EOL>

Return the :class:`~matplotlib.path.Path` object associated
with this line.


if self._invalid:<EOL><INDENT>self.recache()<EOL><DEDENT>return self._xy<EOL>

Return the *xy* data as a Nx2 numpy array.


self._antialiased = b<EOL>

True if line should be drawin with antialiased rendering

ACCEPTS: [True | False]


self._color = color<EOL>

Set the color of the line

ACCEPTS: any matplotlib color


self._drawstyle = drawstyle<EOL>

Set the drawstyle of the plot

'default' connects the points with lines. The steps variants
produce step-plots. 'steps' is equivalent to 'steps-pre' and
is maintained for backward-compatibility.

ACCEPTS: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ]


self._linewidth = w<EOL>

Set the line width in points

ACCEPTS: float value in points


<EOL>for ds in flatten([list(k.keys()) for k in (self._drawStyles_l,<EOL>self._drawStyles_s)], is_string_like):<EOL><INDENT>if linestyle.startswith(ds):<EOL><INDENT>self.set_drawstyle(ds)<EOL>if len(linestyle) > len(ds):<EOL><INDENT>linestyle = linestyle[len(ds):]<EOL><DEDENT>else:<EOL><INDENT>linestyle = '<STR_LIT:->'<EOL><DEDENT><DEDENT><DEDENT>if linestyle not in self._lineStyles:<EOL><INDENT>if linestyle in ls_mapper:<EOL><INDENT>linestyle = ls_mapper[linestyle]<EOL><DEDENT>else:<EOL><INDENT>verbose.report('<STR_LIT>' %<EOL>(linestyle, type(linestyle)))<EOL><DEDENT><DEDENT>if linestyle in ['<STR_LIT:U+0020>','<STR_LIT>']:<EOL><INDENT>linestyle = '<STR_LIT:None>'<EOL><DEDENT>self._linestyle = linestyle<EOL>

Set the linestyle of the line (also accepts drawstyles)

================    =================
linestyle           description
================    =================
'-'                 solid
'--'                dashed
'-.'                dash_dot
':'                 dotted
'None'              draw nothing
' '                 draw nothing
''                  draw nothing
================    =================

'steps' is equivalent to 'steps-pre' and is maintained for
backward-compatibility.

.. seealso::
    :meth:`set_drawstyle`

ACCEPTS: [ '-' | '--' | '-.' | ':' | 'None' | ' ' | '' ] and
any drawstyle in combination with a linestyle, e.g. 'steps--'.


if marker not in self._markers:<EOL><INDENT>verbose.report('<STR_LIT>' %<EOL>(marker, type(marker)))<EOL><DEDENT>if marker in ['<STR_LIT:U+0020>','<STR_LIT>']:<EOL><INDENT>marker = '<STR_LIT:None>'<EOL><DEDENT>self._marker = marker<EOL>self._markerFunc = self._markers[marker]<EOL>

Set the line marker

========== ==========================
marker     description
========== ==========================
'.'        point
','        pixel
'o'        circle
'v'        triangle_down
'^'        triangle_up
'<'        triangle_left
'>'        triangle_right
'1'        tri_down
'2'        tri_up
'3'        tri_left
'4'        tri_right
's'        square
'p'        pentagon
'*'        star
'h'        hexagon1
'H'        hexagon2
'+'        plus
'x'        x
'D'        diamond
'd'        thin_diamond
'|'        vline
'_'        hline
TICKLEFT   tickleft
TICKRIGHT  tickright
TICKUP     tickup
TICKDOWN   tickdown
CARETLEFT  caretleft
CARETRIGHT caretright
CARETUP    caretup
CARETDOWN  caretdown
'None'     nothing
' '        nothing
''         nothing
========== ==========================

ACCEPTS: [ '+' | '*' | ',' | '.' | '1' | '2' | '3' | '4'
         | '<' | '>' | 'D' | 'H' | '^' | '_' | 'd'
         | 'h' | 'o' | 'p' | 's' | 'v' | 'x' | '|'
         | TICKUP | TICKDOWN | TICKLEFT | TICKRIGHT
         | 'None' | ' ' | '' ]


if ec is None :<EOL><INDENT>ec = '<STR_LIT>'<EOL><DEDENT>self._markeredgecolor = ec<EOL>

Set the marker edge color

ACCEPTS: any matplotlib color


if ew is None :<EOL><INDENT>ew = rcParams['<STR_LIT>']<EOL><DEDENT>self._markeredgewidth = ew<EOL>

Set the marker edge width in points

ACCEPTS: float value in points


if fc is None :<EOL><INDENT>fc = '<STR_LIT>'<EOL><DEDENT>self._markerfacecolor = fc<EOL>

Set the marker face color

ACCEPTS: any matplotlib color


self._markersize = sz<EOL>

Set the marker size in points

ACCEPTS: float


x = np.asarray(x)<EOL>self.set_data(x, self._yorig)<EOL>

Set the data np.array for x

ACCEPTS: 1D array


y = np.asarray(y)<EOL>self.set_data(self._xorig, y)<EOL>

Set the data np.array for y

ACCEPTS: 1D array


if seq == (None, None) or len(seq)==<NUM_LIT:0>:<EOL><INDENT>self.set_linestyle('<STR_LIT:->')<EOL><DEDENT>else:<EOL><INDENT>self.set_linestyle('<STR_LIT>')<EOL><DEDENT>self._dashSeq = seq<EOL>

Set the dash sequence, sequence of dashes with on off ink in
points.  If seq is empty or if seq = (None, None), the
linestyle will be set to solid.

ACCEPTS: sequence of on/off ink in points


Artist.update_from(self, other)<EOL>self._linestyle = other._linestyle<EOL>self._linewidth = other._linewidth<EOL>self._color = other._color<EOL>self._markersize = other._markersize<EOL>self._markerfacecolor = other._markerfacecolor<EOL>self._markeredgecolor = other._markeredgecolor<EOL>self._markeredgewidth = other._markeredgewidth<EOL>self._dashSeq = other._dashSeq<EOL>self._dashcapstyle = other._dashcapstyle<EOL>self._dashjoinstyle = other._dashjoinstyle<EOL>self._solidcapstyle = other._solidcapstyle<EOL>self._solidjoinstyle = other._solidjoinstyle<EOL>self._linestyle = other._linestyle<EOL>self._marker = other._marker<EOL>self._drawstyle = other._drawstyle<EOL>


return self.get_antialiased()<EOL>


return self.get_color()<EOL>


return self.get_linestyle()<EOL>


return self.get_linewidth()<EOL>


return self.get_markeredgecolor()<EOL>


return self.get_markeredgewidth()<EOL>


return self.get_markerfacecolor()<EOL>


return self.get_markersize()<EOL>


s = s.lower()<EOL>if s not in self.validJoin:<EOL><INDENT>raise ValueError('<STR_LIT>' % (s,)<EOL>+ '<STR_LIT>' % (self.validJoin,))<EOL><DEDENT>self._dashjoinstyle = s<EOL>

Set the join style for dashed linestyles
ACCEPTS: ['miter' | 'round' | 'bevel']


s = s.lower()<EOL>if s not in self.validJoin:<EOL><INDENT>raise ValueError('<STR_LIT>' % (s,)<EOL>+ '<STR_LIT>' % (self.validJoin,))<EOL><DEDENT>self._solidjoinstyle = s<EOL>

Set the join style for solid linestyles
ACCEPTS: ['miter' | 'round' | 'bevel']


return self._dashjoinstyle<EOL>

Get the join style for dashed linestyles


return self._solidjoinstyle<EOL>


s = s.lower()<EOL>if s not in self.validCap:<EOL><INDENT>raise ValueError('<STR_LIT>' % (s,)<EOL>+ '<STR_LIT>' % (self.validCap,))<EOL><DEDENT>self._dashcapstyle = s<EOL>

Set the cap style for dashed linestyles

ACCEPTS: ['butt' | 'round' | 'projecting']


s = s.lower()<EOL>if s not in self.validCap:<EOL><INDENT>raise ValueError('<STR_LIT>' % (s,)<EOL>+ '<STR_LIT>' % (self.validCap,))<EOL><DEDENT>self._solidcapstyle = s<EOL>

Set the cap style for solid linestyles

ACCEPTS: ['butt' | 'round' |  'projecting']


return self._dashcapstyle<EOL>


return self._solidcapstyle<EOL>


return self._linestyle in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT::>')<EOL>


if not hasattr(line, '<STR_LIT>'):<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>if line.get_picker() is None:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>self.axes = line.axes<EOL>self.line = line<EOL>self.canvas = self.axes.figure.canvas<EOL>self.cid = self.canvas.mpl_connect('<STR_LIT>', self.onpick)<EOL>self.ind = set()<EOL>

Initialize the class with a :class:`matplotlib.lines.Line2D`
instance.  The line should already be added to some
:class:`matplotlib.axes.Axes` instance and should have the
picker property set.


def process_selected(self, ind, xs, ys):

pass<EOL>

Default "do nothing" implementation of the
:meth:`process_selected` method.

*ind* are the indices of the selected vertices.  *xs* and *ys*
are the coordinates of the selected vertices.


if event.artist is not self.line: return<EOL>for i in event.ind:<EOL><INDENT>if i in self.ind:<EOL><INDENT>self.ind.remove(i)<EOL><DEDENT>else:<EOL><INDENT>self.ind.add(i)<EOL><DEDENT><DEDENT>ind = list(self.ind)<EOL>ind.sort()<EOL>xdata, ydata = self.line.get_data()<EOL>self.process_selected(ind, xdata[ind], ydata[ind])<EOL>

When the line is picked, update the set of selected indicies.


long = long * (<NUM_LIT> / np.pi)<EOL>lat = lat * (<NUM_LIT> / np.pi)<EOL>if lat >= <NUM_LIT:0.0>:<EOL><INDENT>ns = '<STR_LIT:N>'<EOL><DEDENT>else:<EOL><INDENT>ns = '<STR_LIT:S>'<EOL><DEDENT>if long >= <NUM_LIT:0.0>:<EOL><INDENT>ew = '<STR_LIT:E>'<EOL><DEDENT>else:<EOL><INDENT>ew = '<STR_LIT>'<EOL><DEDENT>return u'<STR_LIT>' % (abs(lat), ns, abs(long), ew)<EOL>

return a format string formatting the coordinate


number = (<NUM_LIT> / degrees) + <NUM_LIT:1><EOL>self.xaxis.set_major_locator(<EOL>FixedLocator(<EOL>np.linspace(-np.pi, np.pi, number, True)[<NUM_LIT:1>:-<NUM_LIT:1>]))<EOL>self._logitude_degrees = degrees<EOL>self.xaxis.set_major_formatter(self.ThetaFormatter(degrees))<EOL>

Set the number of degrees between each longitude grid.


number = (<NUM_LIT> / degrees) + <NUM_LIT:1><EOL>self.yaxis.set_major_locator(<EOL>FixedLocator(<EOL>np.linspace(-np.pi / <NUM_LIT>, np.pi / <NUM_LIT>, number, True)[<NUM_LIT:1>:-<NUM_LIT:1>]))<EOL>self._latitude_degrees = degrees<EOL>self.yaxis.set_major_formatter(self.ThetaFormatter(degrees))<EOL>


self._longitude_cap = degrees * (np.pi / <NUM_LIT>)<EOL>self._xaxis_pretransform.clear().scale(<NUM_LIT:1.0>, self._longitude_cap * <NUM_LIT>).translate(<NUM_LIT:0.0>, -self._longitude_cap)<EOL>

Set the latitude(s) at which to stop drawing the longitude grids.


return <NUM_LIT:1.0><EOL>

Return the aspect ratio of the data itself.


return False<EOL>

Return True if this axes support the zoom box


self._rpad = <NUM_LIT><EOL>self.resolution = kwargs.pop('<STR_LIT>', self.RESOLUTION)<EOL>Axes.__init__(self, *args, **kwargs)<EOL>self.set_aspect('<STR_LIT>', adjustable='<STR_LIT>', anchor='<STR_LIT:C>')<EOL>self.cla()<EOL>

Create a new Polar Axes for a polar plot.


def set_thetagrids(self, angles, labels=None, frac=None,<EOL>**kwargs):

angles = npy.asarray(angles, npy.float_)<EOL>self.set_xticks(angles * (npy.pi / <NUM_LIT>))<EOL>if labels is not None:<EOL><INDENT>self.set_xticklabels(labels)<EOL><DEDENT>if frac is not None:<EOL><INDENT>self._theta_label1_position.clear().translate(<NUM_LIT:0.0>, frac)<EOL>self._theta_label2_position.clear().translate(<NUM_LIT:0.0>, <NUM_LIT:1.0> / frac)<EOL><DEDENT>for t in self.xaxis.get_ticklabels():<EOL><INDENT>t.update(kwargs)<EOL><DEDENT>return self.xaxis.get_ticklines(), self.xaxis.get_ticklabels()<EOL>

Set the angles at which to place the theta grids (these
gridlines are equal along the theta dimension).  *angles* is in
degrees.

*labels*, if not None, is a ``len(angles)`` list of strings of
the labels to use at each angle.

If *labels* is None, the labels will be ``fmt %% angle``

*frac* is the fraction of the polar axes radius at which to
place the label (1 is the edge). Eg. 1.05 is outside the axes
and 0.95 is inside the axes.

Return value is a list of tuples (*line*, *label*), where
*line* is :class:`~matplotlib.lines.Line2D` instances and the
*label* is :class:`~matplotlib.text.Text` instances.

kwargs are optional text properties for the labels:

%(Text)s

ACCEPTS: sequence of floats


def set_rgrids(self, radii, labels=None, angle=None, rpad=None, **kwargs):

radii = npy.asarray(radii)<EOL>rmin = radii.min()<EOL>if rmin <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>self.set_yticks(radii)<EOL>if labels is not None:<EOL><INDENT>self.set_yticklabels(labels)<EOL><DEDENT>if angle is None:<EOL><INDENT>angle = self._r_label1_position.to_values()[<NUM_LIT:4>]<EOL><DEDENT>if rpad is not None:<EOL><INDENT>self._rpad = rpad<EOL><DEDENT>rmax = self.get_rmax()<EOL>self._r_label1_position.clear().translate(angle, self._rpad * rmax)<EOL>self._r_label2_position.clear().translate(angle, -self._rpad * rmax)<EOL>for t in self.yaxis.get_ticklabels():<EOL><INDENT>t.update(kwargs)<EOL><DEDENT>return self.yaxis.get_ticklines(), self.yaxis.get_ticklabels()<EOL>

Set the radial locations and labels of the *r* grids.

The labels will appear at radial distances *radii* at the
given *angle* in degrees.

*labels*, if not None, is a ``len(radii)`` list of strings of the
labels to use at each radius.

If *labels* is None, the built-in formatter will be used.

*rpad* is a fraction of the max of *radii* which will pad each of
the radial labels in the radial direction.

Return value is a list of tuples (*line*, *label*), where
*line* is :class:`~matplotlib.lines.Line2D` instances and the
*label* is :class:`~matplotlib.text.Text` instances.

kwargs are optional text properties for the labels:

%(Text)s

ACCEPTS: sequence of floats


theta /= math.pi<EOL>return u'<STR_LIT>' % (theta, theta * <NUM_LIT>, r)<EOL>

Return a format string formatting the coordinate using Unicode
characters.


return <NUM_LIT:1.0><EOL>

Return the aspect ratio of the data itself.  For a polar plot,
this should always be 1.0


return False<EOL>


if projection is None:<EOL><INDENT>projection = '<STR_LIT>'<EOL><DEDENT>try:<EOL><INDENT>return projection_registry.get_projection_class(projection)<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ValueError("<STR_LIT>" % projection)<EOL><DEDENT>

Get a projection class from its name.

If *projection* is None, a standard rectilinear projection is
returned.


def projection_factory(projection, figure, rect, **kwargs):

return get_projection_class(projection)(figure, rect, **kwargs)<EOL>

Get a new projection instance.

*projection* is a projection name.

*figure* is a figure to add the axes to.

*rect* is a :class:`~matplotlib.transforms.Bbox` object specifying
the location of the axes within the figure.

Any other kwargs are passed along to the specific projection
constructor being used.


return projection_registry.get_projection_names()<EOL>

Get a list of acceptable projection names.


for projection in projections:<EOL><INDENT>name = projection.name<EOL>self._all_projection_types[name] = projection<EOL><DEDENT>


return self._all_projection_types[name]<EOL>


names = self._all_projection_types.keys()<EOL>names.sort()<EOL>return names<EOL>

Get a list of the names of all projections currently
registered.


<EOL>idx = data.index('<STR_LIT>')<EOL>idx += len('<STR_LIT>')<EOL>while data[idx] in '<STR_LIT>':<EOL><INDENT>idx += <NUM_LIT:1><EOL><DEDENT>len1 = idx<EOL>idx = data.rindex('<STR_LIT>') - <NUM_LIT:1><EOL>zeros = <NUM_LIT><EOL>while zeros and data[idx] in ('<STR_LIT:0>', '<STR_LIT:\n>', '<STR_LIT:\r>'):<EOL><INDENT>if data[idx] == '<STR_LIT:0>':<EOL><INDENT>zeros -= <NUM_LIT:1><EOL><DEDENT>idx -= <NUM_LIT:1><EOL><DEDENT>if zeros:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>binary = '<STR_LIT>'.join([chr(int(data[i:i+<NUM_LIT:2>], <NUM_LIT:16>))<EOL>for i in range(len1, idx, <NUM_LIT:2>)])<EOL>return data[:len1], binary, data[idx:]<EOL>

Split the Type 1 font into its three main parts.

The three parts are: (1) the cleartext part, which ends in a
eexec operator; (2) the encrypted part; (3) the fixed part,
which contains 512 ASCII zeros possibly divided on various
lines, a cleartomark operator, and possibly something else.


def tokens(text):<EOL><INDENT>"""<STR_LIT>"""<EOL>pos = <NUM_LIT:0><EOL>while pos < len(text):<EOL><INDENT>match = self._comment.match(text[pos:]) or self._whitespace.match(text[pos:])<EOL>if match:<EOL><INDENT>pos += match.end()<EOL><DEDENT>elif text[pos] == '<STR_LIT:(>':<EOL><INDENT>start = pos<EOL>pos += <NUM_LIT:1><EOL>depth = <NUM_LIT:1><EOL>while depth:<EOL><INDENT>match = self._instring.search(text[pos:])<EOL>if match is None: return<EOL>if match.group() == '<STR_LIT:(>':<EOL><INDENT>depth += <NUM_LIT:1><EOL>pos += <NUM_LIT:1><EOL><DEDENT>elif match.group() == '<STR_LIT:)>':<EOL><INDENT>depth -= <NUM_LIT:1><EOL>pos += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>pos += <NUM_LIT:2><EOL><DEDENT><DEDENT>yield (start, text[start:pos])<EOL><DEDENT>elif text[pos:pos+<NUM_LIT:2>] in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>yield (pos, text[pos:pos+<NUM_LIT:2>])<EOL>pos += <NUM_LIT:2><EOL><DEDENT>elif text[pos] == '<STR_LIT:<>':<EOL><INDENT>start = pos<EOL>pos += text[pos:].index('<STR_LIT:>>')<EOL>yield (start, text[start:pos])<EOL><DEDENT>else:<EOL><INDENT>match = self._token.match(text[pos:])<EOL>if match:<EOL><INDENT>yield (pos, match.group())<EOL>pos += match.end()<EOL><DEDENT>else:<EOL><INDENT>yield (pos, text[pos])<EOL>pos += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT><DEDENT>enc_starts, enc_ends = None, None<EOL>state = <NUM_LIT:0><EOL>for pos,token in tokens(self.parts[<NUM_LIT:0>]):<EOL><INDENT>if state == <NUM_LIT:0> and token == '<STR_LIT>':<EOL><INDENT>enc_starts = pos<EOL>state = <NUM_LIT:1><EOL><DEDENT>elif state == <NUM_LIT:1> and token == '<STR_LIT>':<EOL><INDENT>state = <NUM_LIT:2><EOL><DEDENT>elif state in (<NUM_LIT:2>,<NUM_LIT:5>) and token == '<STR_LIT>':<EOL><INDENT>enc_ends = pos+<NUM_LIT:3><EOL>break<EOL><DEDENT>elif state in (<NUM_LIT:1>,<NUM_LIT:5>) and token == '<STR_LIT>':<EOL><INDENT>state = <NUM_LIT:4><EOL><DEDENT>elif state == <NUM_LIT:4> and token == '<STR_LIT>':<EOL><INDENT>state = <NUM_LIT:5><EOL><DEDENT><DEDENT>self.enc_starts, self.enc_ends = enc_starts, enc_ends<EOL>

A very limited kind of parsing to find the Encoding of the
font.


def get_basefile(self, tex, fontsize, dpi=None):

s = '<STR_LIT>'.join([tex, self.get_font_config(), '<STR_LIT>'%fontsize,<EOL>self.get_custom_preamble(), str(dpi or '<STR_LIT>')])<EOL>bytes = str(s).encode('<STR_LIT:utf-8>')<EOL>return os.path.join(self.texcache, md5(bytes).hexdigest())<EOL>

returns a filename based on a hash of the string, fontsize, and dpi


if self._rc_cache is None:<EOL><INDENT>self._rc_cache = dict([(k,None) for k in self._rc_cache_keys])<EOL><DEDENT>changed = [par for par in self._rc_cache_keys if rcParams[par] !=self._rc_cache[par]]<EOL>if changed:<EOL><INDENT>if DEBUG: print('<STR_LIT>', changed)<EOL>for k in changed:<EOL><INDENT>if DEBUG:<EOL><INDENT>print('<STR_LIT>' %(k, self._rc_cache[k], rcParams[k]))<EOL><DEDENT>self._rc_cache[k] = copy.deepcopy(rcParams[k])<EOL><DEDENT>if DEBUG: print('<STR_LIT>', self._fontconfig)<EOL>self.__init__()<EOL><DEDENT>if DEBUG: print('<STR_LIT>', self._fontconfig)<EOL>return self._fontconfig<EOL>

Reinitializes self if relevant rcParams on have changed.


return self._font_preamble<EOL>

returns a string containing font configuration for the tex preamble


return '<STR_LIT:\n>'.join(rcParams['<STR_LIT>'])<EOL>

returns a string containing user additions to the tex preamble


if sys.platform == '<STR_LIT:win32>':<EOL><INDENT>command = ['<STR_LIT:%s>'% os.path.splitdrive(self.texcache)[<NUM_LIT:0>]]<EOL><DEDENT>else:<EOL><INDENT>command = []<EOL><DEDENT>command.extend(args)<EOL>return '<STR_LIT>'.join(command)<EOL>

On windows, changing directories can be complicated by the presence of
multiple drives. get_shell_cmd deals with this issue.


basefile = self.get_basefile(tex, fontsize)<EOL>texfile = '<STR_LIT>'%basefile<EOL>fh = file(texfile, '<STR_LIT:w>')<EOL>custom_preamble = self.get_custom_preamble()<EOL>fontcmd = {'<STR_LIT>' : r'<STR_LIT>',<EOL>'<STR_LIT>'  : r'<STR_LIT>'}.get(self.font_family,<EOL>r'<STR_LIT>')<EOL>tex = fontcmd % tex<EOL>if rcParams['<STR_LIT>']:<EOL><INDENT>unicode_preamble = """<STR_LIT>"""<EOL><DEDENT>else:<EOL><INDENT>unicode_preamble = '<STR_LIT>'<EOL><DEDENT>s =

Generate a tex file to render the tex string at a specific font size

returns the file name


basefile = self.get_basefile(tex, fontsize)<EOL>dvifile = '<STR_LIT>'% basefile<EOL>if DEBUG or not os.path.exists(dvifile):<EOL><INDENT>texfile = self.make_tex(tex, fontsize)<EOL>outfile = basefile+'<STR_LIT>'<EOL>command = self._get_shell_cmd('<STR_LIT>'% self.texcache,<EOL>'<STR_LIT>'%(os.path.split(texfile)[-<NUM_LIT:1>], outfile))<EOL>mpl.verbose.report(command, '<STR_LIT>')<EOL>exit_status = os.system(command)<EOL>try:<EOL><INDENT>fh = file(outfile)<EOL>report = fh.read()<EOL>fh.close()<EOL><DEDENT>except IOError:<EOL><INDENT>report = '<STR_LIT>'<EOL><DEDENT>if exit_status:<EOL><INDENT>raise RuntimeError(('<STR_LIT>'% repr(tex)) + report)<EOL><DEDENT>else: mpl.verbose.report(report, '<STR_LIT>')<EOL>for fname in glob.glob(basefile+'<STR_LIT:*>'):<EOL><INDENT>if fname.endswith('<STR_LIT>'): pass<EOL>elif fname.endswith('<STR_LIT>'): pass<EOL>else:<EOL><INDENT>try: os.remove(fname)<EOL>except OSError: pass<EOL><DEDENT><DEDENT><DEDENT>return dvifile<EOL>

generates a dvi file containing latex's layout of tex string

returns the file name


basefile = self.get_basefile(tex, fontsize, dpi)<EOL>pngfile = '<STR_LIT>'% basefile<EOL>if DEBUG or not os.path.exists(pngfile):<EOL><INDENT>dvifile = self.make_dvi(tex, fontsize)<EOL>outfile = basefile+'<STR_LIT>'<EOL>command = self._get_shell_cmd('<STR_LIT>' % self.texcache,<EOL>'<STR_LIT>'%(dpi, os.path.split(pngfile)[-<NUM_LIT:1>],<EOL>os.path.split(dvifile)[-<NUM_LIT:1>], outfile))<EOL>mpl.verbose.report(command, '<STR_LIT>')<EOL>exit_status = os.system(command)<EOL>try:<EOL><INDENT>fh = file(outfile)<EOL>report = fh.read()<EOL>fh.close()<EOL><DEDENT>except IOError:<EOL><INDENT>report = '<STR_LIT>'<EOL><DEDENT>if exit_status:<EOL><INDENT>raise RuntimeError('dvipng was not able to \ the flowing file:\n%s\nHere is the full report generated by dvipng: \ vifile + report)else: mpl.verbose.report(report, '<STR_LIT>')<EOL>try: os.remove(outfile)<EOL>except OSError: pass<EOL>return pngfile<EOL>

generates a png file containing latex's rendering of tex string

returns the filename


basefile = self.get_basefile(tex, fontsize)<EOL>psfile = '<STR_LIT>'% basefile<EOL>if DEBUG or not os.path.exists(psfile):<EOL><INDENT>dvifile = self.make_dvi(tex, fontsize)<EOL>outfile = basefile+'<STR_LIT>'<EOL>command = self._get_shell_cmd('<STR_LIT>'% self.texcache,<EOL>'<STR_LIT>'%(os.path.split(psfile)[-<NUM_LIT:1>],<EOL>os.path.split(dvifile)[-<NUM_LIT:1>], outfile))<EOL>mpl.verbose.report(command, '<STR_LIT>')<EOL>exit_status = os.system(command)<EOL>fh = file(outfile)<EOL>if exit_status:<EOL><INDENT>raise RuntimeError('dvipng was not able to \ the flowing file:\n%s\nHere is the full report generated by dvipng: \ vifile + fh.read())else: mpl.verbose.report(fh.read(), '<STR_LIT>')<EOL>fh.close()<EOL>os.remove(outfile)<EOL>return psfile<EOL>

generates a postscript file containing latex's rendering of tex string

returns the file name


psfile = self.make_ps(tex, fontsize)<EOL>ps = file(psfile)<EOL>for line in ps:<EOL><INDENT>if line.startswith('<STR_LIT>'):<EOL><INDENT>return [int(val) for val in line.split()[<NUM_LIT:1>:]]<EOL><DEDENT><DEDENT>raise RuntimeError('<STR_LIT>'%psfile)<EOL>

returns a list containing the postscript bounding box for latex's
rendering of the tex string


def get_grey(self, tex, fontsize=None, dpi=None):

key = tex, self.get_font_config(), fontsize, dpi<EOL>alpha = self.grey_arrayd.get(key)<EOL>if alpha is None:<EOL><INDENT>pngfile = self.make_png(tex, fontsize, dpi)<EOL>X = read_png(os.path.join(self.texcache, pngfile))<EOL>if rcParams['<STR_LIT>'] is not None:<EOL><INDENT>hack = rcParams['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>hack = self._dvipng_hack_alpha<EOL><DEDENT>if hack:<EOL><INDENT>alpha = <NUM_LIT:1>-X[:,:,<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>alpha = X[:,:,-<NUM_LIT:1>]<EOL><DEDENT>self.grey_arrayd[key] = alpha<EOL><DEDENT>return alpha<EOL>


def get_rgba(self, tex, fontsize=None, dpi=None, rgb=(<NUM_LIT:0>,<NUM_LIT:0>,<NUM_LIT:0>)):

if not fontsize: fontsize = rcParams['<STR_LIT>']<EOL>if not dpi: dpi = rcParams['<STR_LIT>']<EOL>r,g,b = rgb<EOL>key = tex, self.get_font_config(), fontsize, dpi, tuple(rgb)<EOL>Z = self.rgba_arrayd.get(key)<EOL>if Z is None:<EOL><INDENT>alpha = self.get_grey(tex, fontsize, dpi)<EOL>Z = np.zeros((alpha.shape[<NUM_LIT:0>], alpha.shape[<NUM_LIT:1>], <NUM_LIT:4>), np.float)<EOL>Z[:,:,<NUM_LIT:0>] = r<EOL>Z[:,:,<NUM_LIT:1>] = g<EOL>Z[:,:,<NUM_LIT:2>] = b<EOL>Z[:,:,<NUM_LIT:3>] = alpha<EOL>self.rgba_arrayd[key] = Z<EOL><DEDENT>return Z<EOL>

Returns latex's rendering of the tex string as an rgba array


if (isinstance(x_transform, Affine2DBase)<EOL>and isinstance(y_transform, Affine2DBase)):<EOL><INDENT>return BlendedAffine2D(x_transform, y_transform)<EOL><DEDENT>return BlendedGenericTransform(x_transform, y_transform)<EOL>

Create a new "blended" transform using *x_transform* to transform
the *x*-axis and *y_transform* to transform the *y*-axis.

A faster version of the blended transform is returned for the case
where both child transforms are affine.


if isinstance(a, IdentityTransform):<EOL><INDENT>return b<EOL><DEDENT>elif isinstance(b, IdentityTransform):<EOL><INDENT>return a<EOL><DEDENT>elif isinstance(a, AffineBase) and isinstance(b, AffineBase):<EOL><INDENT>return CompositeAffine2D(a, b)<EOL><DEDENT>return CompositeGenericTransform(a, b)<EOL>

Create a new composite transform that is the result of applying
transform a then transform b.

Shortcut versions of the blended transform are provided for the
case where both child transforms are affine, or one or the other
is the identity transform.

Composite transforms may also be created using the '+' operator,
e.g.::

  c = a + b


def nonsingular(vmin, vmax, expander=<NUM_LIT>, tiny=<NUM_LIT>, increasing=True):

if (not np.isfinite(vmin)) or (not np.isfinite(vmax)):<EOL><INDENT>return -expander, expander<EOL><DEDENT>swapped = False<EOL>if vmax < vmin:<EOL><INDENT>vmin, vmax = vmax, vmin<EOL>swapped = True<EOL><DEDENT>if vmax - vmin <= max(abs(vmin), abs(vmax)) * tiny:<EOL><INDENT>if vmin == <NUM_LIT:0.0>:<EOL><INDENT>vmin = -expander<EOL>vmax = expander<EOL><DEDENT>else:<EOL><INDENT>vmin -= expander*abs(vmin)<EOL>vmax += expander*abs(vmax)<EOL><DEDENT><DEDENT>if swapped and not increasing:<EOL><INDENT>vmin, vmax = vmax, vmin<EOL><DEDENT>return vmin, vmax<EOL>

Ensure the endpoints of a range are finite and not too close together.

"too close" means the interval is smaller than 'tiny' times
the maximum absolute value.

If they are too close, each will be moved by the 'expander'.
If 'increasing' is True and vmin > vmax, they will be swapped,
regardless of whether they are too close.

If either is inf or -inf or nan, return - expander, expander.


def offset_copy(trans, fig, x=<NUM_LIT:0.0>, y=<NUM_LIT:0.0>, units='<STR_LIT>'):

if units == '<STR_LIT>':<EOL><INDENT>return trans + Affine2D().translate(x, y)<EOL><DEDENT>if fig is None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if units == '<STR_LIT>':<EOL><INDENT>x /= <NUM_LIT><EOL>y /= <NUM_LIT><EOL><DEDENT>elif not units == '<STR_LIT>':<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return trans + ScaledTranslation(x, y, fig.dpi_scale_trans)<EOL>

Return a new transform with an added offset.
  args:
    trans is any transform
  kwargs:
    fig is the current figure; it can be None if units are 'dots'
    x, y give the offset
    units is 'inches', 'points' or 'dots'


<EOL>self._parents = WeakKeyDictionary()<EOL>self._invalid = <NUM_LIT:1><EOL>


<EOL>value = (self.is_affine) and self.INVALID_AFFINE or self.INVALID<EOL>if self._invalid == value:<EOL><INDENT>return<EOL><DEDENT>if not len(self._parents):<EOL><INDENT>self._invalid = value<EOL>return<EOL><DEDENT>stack = [self]<EOL>while len(stack):<EOL><INDENT>root = stack.pop()<EOL>if root._invalid != value or root.pass_through:<EOL><INDENT>root._invalid = self.INVALID<EOL>stack.extend(list(root._parents.keys()))<EOL><DEDENT><DEDENT>

Invalidate this :class:`TransformNode` and all of its
ancestors.  Should be called any time the transform changes.


for child in children:<EOL><INDENT>child._parents[self] = None<EOL><DEDENT>

Set the children of the transform, to let the invalidation
system know which transforms can invalidate this transform.
Should be called from the constructor of any transforms that
depend on other transforms.


return self<EOL>

Returns a frozen copy of this transform node.  The frozen copy
will not update when its children change.  Useful for storing
a previously known state of a transform where
``copy.deepcopy()`` might normally be used.


return list(self.get_points().flatten()) == [<NUM_LIT:0.>, <NUM_LIT:0.>, <NUM_LIT:1.>, <NUM_LIT:1.>]<EOL>

Returns True if the :class:`Bbox` is the unit bounding box
from (0, 0) to (1, 1).


x0, x1 = self.intervalx<EOL>return ((x0 < x1<EOL>and (x >= x0 and x <= x1))<EOL>or (x >= x1 and x <= x0))<EOL>

Returns True if *x* is between or equal to :attr:`x0` and
:attr:`x1`.


y0, y1 = self.intervaly<EOL>return ((y0 < y1<EOL>and (y >= y0 and y <= y1))<EOL>or (y >= y1 and y <= y0))<EOL>

Returns True if *y* is between or equal to :attr:`y0` and
:attr:`y1`.


return self.containsx(x) and self.containsy(y)<EOL>

Returns *True* if (*x*, *y*) is a coordinate inside the
bounding box or on its edge.


ax1, ay1, ax2, ay2 = self._get_extents()<EOL>bx1, by1, bx2, by2 = other._get_extents()<EOL>if ax2 < ax1:<EOL><INDENT>ax2, ax1 = ax1, ax2<EOL><DEDENT>if ay2 < ay1:<EOL><INDENT>ay2, ay1 = ay1, ay2<EOL><DEDENT>if bx2 < bx1:<EOL><INDENT>bx2, bx1 = bx1, bx2<EOL><DEDENT>if by2 < by1:<EOL><INDENT>by2, by1 = by1, by2<EOL><DEDENT>return not ((bx2 < ax1) or<EOL>(by2 < ay1) or<EOL>(bx1 > ax2) or<EOL>(by1 > ay2))<EOL>

Returns True if this bounding box overlaps with the given
bounding box *other*.


x0, x1 = self.intervalx<EOL>return ((x0 < x1<EOL>and (x > x0 and x < x1))<EOL>or (x > x1 and x < x0))<EOL>

Returns True if *x* is between but not equal to :attr:`x0` and
:attr:`x1`.


y0, y1 = self.intervaly<EOL>return ((y0 < y1<EOL>and (x > y0 and x < y1))<EOL>or (x > y1 and x < y0))<EOL>

Returns True if *y* is between but not equal to :attr:`y0` and
:attr:`y1`.


return self.fully_containsx(x)and self.fully_containsy(y)<EOL>

Returns True if (*x*, *y*) is a coordinate inside the bounding
box, but not on its edge.


ax1, ay1, ax2, ay2 = self._get_extents()<EOL>bx1, by1, bx2, by2 = other._get_extents()<EOL>if ax2 < ax1:<EOL><INDENT>ax2, ax1 = ax1, ax2<EOL><DEDENT>if ay2 < ay1:<EOL><INDENT>ay2, ay1 = ay1, ay2<EOL><DEDENT>if bx2 < bx1:<EOL><INDENT>bx2, bx1 = bx1, bx2<EOL><DEDENT>if by2 < by1:<EOL><INDENT>by2, by1 = by1, by2<EOL><DEDENT>return not ((bx2 <= ax1) or<EOL>(by2 <= ay1) or<EOL>(bx1 >= ax2) or<EOL>(by1 >= ay2))<EOL>

Returns True if this bounding box overlaps with the given
bounding box *other*, but not on its edge alone.


return Bbox(transform.transform(self.get_points()))<EOL>

Return a new :class:`Bbox` object, statically transformed by
the given transform.


return Bbox(transform.inverted().transform(self.get_points()))<EOL>

Return a new :class:`Bbox` object, statically transformed by
the inverse of the given transform.


def anchored(self, c, container = None):

if container is None:<EOL><INDENT>container = self<EOL><DEDENT>l, b, w, h = container.bounds<EOL>if isinstance(c, str):<EOL><INDENT>cx, cy = self.coefs[c]<EOL><DEDENT>else:<EOL><INDENT>cx, cy = c<EOL><DEDENT>L, B, W, H = self.bounds<EOL>return Bbox(self._points +<EOL>[(l + cx * (w-W)) - L,<EOL>(b + cy * (h-H)) - B])<EOL>

Return a copy of the :class:`Bbox`, shifted to position *c*
within a container.

*c*: may be either:

  * a sequence (*cx*, *cy*) where *cx* and *cy* range from 0
    to 1, where 0 is left or bottom and 1 is right or top

  * a string:
    - 'C' for centered
    - 'S' for bottom-center
    - 'SE' for bottom-left
    - 'E' for left
    - etc.

Optional argument *container* is the box within which the
:class:`Bbox` is positioned; it defaults to the initial
:class:`Bbox`.


w, h = self.size<EOL>return Bbox([self._points[<NUM_LIT:0>],<EOL>self._points[<NUM_LIT:0>] + [mx * w, my * h]])<EOL>

Return a copy of the :class:`Bbox`, shrunk by the factor *mx*
in the *x* direction and the factor *my* in the *y* direction.
The lower left corner of the box remains unchanged.  Normally
*mx* and *my* will be less than 1, but this is not enforced.


def shrunk_to_aspect(self, box_aspect, container = None, fig_aspect = <NUM_LIT:1.0>):

assert box_aspect > <NUM_LIT:0> and fig_aspect > <NUM_LIT:0><EOL>if container is None:<EOL><INDENT>container = self<EOL><DEDENT>w, h = container.size<EOL>H = w * box_aspect/fig_aspect<EOL>if H <= h:<EOL><INDENT>W = w<EOL><DEDENT>else:<EOL><INDENT>W = h * fig_aspect/box_aspect<EOL>H = h<EOL><DEDENT>return Bbox([self._points[<NUM_LIT:0>],<EOL>self._points[<NUM_LIT:0>] + (W, H)])<EOL>

Return a copy of the :class:`Bbox`, shrunk so that it is as
large as it can be while having the desired aspect ratio,
*box_aspect*.  If the box coordinates are relative---that
is, fractions of a larger box such as a figure---then the
physical aspect ratio of that figure is specified with
*fig_aspect*, so that *box_aspect* can also be given as a
ratio of the absolute dimensions, not the relative dimensions.


boxes = []<EOL>xf = [<NUM_LIT:0>] + list(args) + [<NUM_LIT:1>]<EOL>x0, y0, x1, y1 = self._get_extents()<EOL>w = x1 - x0<EOL>for xf0, xf1 in zip(xf[:-<NUM_LIT:1>], xf[<NUM_LIT:1>:]):<EOL><INDENT>boxes.append(Bbox([[x0 + xf0 * w, y0], [x0 + xf1 * w, y1]]))<EOL><DEDENT>return boxes<EOL>

e.g., ``bbox.splitx(f1, f2, ...)``

Returns a list of new :class:`Bbox` objects formed by
splitting the original one with vertical lines at fractional
positions *f1*, *f2*, ...


boxes = []<EOL>yf = [<NUM_LIT:0>] + list(args) + [<NUM_LIT:1>]<EOL>x0, y0, x1, y1 = self._get_extents()<EOL>h = y1 - y0<EOL>for yf0, yf1 in zip(yf[:-<NUM_LIT:1>], yf[<NUM_LIT:1>:]):<EOL><INDENT>boxes.append(Bbox([[x0, y0 + yf0 * h], [x1, y0 + yf1 * h]]))<EOL><DEDENT>return boxes<EOL>

e.g., ``bbox.splitx(f1, f2, ...)``

Returns a list of new :class:`Bbox` objects formed by
splitting the original one with horizontal lines at fractional
positions *f1*, *f2*, ...


if len(vertices) == <NUM_LIT:0>:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>vertices = np.asarray(vertices)<EOL>x0, y0, x1, y1 = self._get_extents()<EOL>dx0 = np.sign(vertices[:, <NUM_LIT:0>] - x0)<EOL>dy0 = np.sign(vertices[:, <NUM_LIT:1>] - y0)<EOL>dx1 = np.sign(vertices[:, <NUM_LIT:0>] - x1)<EOL>dy1 = np.sign(vertices[:, <NUM_LIT:1>] - y1)<EOL>inside = (abs(dx0 + dx1) + abs(dy0 + dy1)) <= <NUM_LIT:2><EOL>return np.sum(inside)<EOL>

Count the number of vertices contained in the :class:`Bbox`.

*vertices* is a Nx2 Numpy array.


return count_bboxes_overlapping_bbox(self, bboxes)<EOL>

Count the number of bounding boxes that overlap this one.

bboxes is a sequence of :class:`BboxBase` objects


width = self.width<EOL>height = self.height<EOL>deltaw = (sw * width - width) / <NUM_LIT><EOL>deltah = (sh * height - height) / <NUM_LIT><EOL>a = np.array([[-deltaw, -deltah], [deltaw, deltah]])<EOL>return Bbox(self._points + a)<EOL>

Return a new :class:`Bbox` which is this :class:`Bbox`
expanded around its center by the given factors *sw* and
*sh*.


points = self._points<EOL>return Bbox(points + [[-p, -p], [p, p]])<EOL>

Return a new :class:`Bbox` that is padded on all four sides by
the given value.


return Bbox(self._points + (tx, ty))<EOL>

Return a copy of the :class:`Bbox`, statically translated by
*tx* and *ty*.


l, b, r, t = self.get_points().flatten()<EOL>return np.array([[l, b], [l, t], [r, b], [r, t]])<EOL>

Return an array of points which are the four corners of this
rectangle.  For example, if this :class:`Bbox` is defined by
the points (*a*, *b*) and (*c*, *d*), :meth:`corners` returns
(*a*, *b*), (*a*, *d*), (*c*, *b*) and (*c*, *d*).


corners = self.corners()<EOL>corners_rotated = Affine2D().rotate(radians).transform(corners)<EOL>bbox = Bbox.unit()<EOL>bbox.update_from_data_xy(corners_rotated, ignore=True)<EOL>return bbox<EOL>

Return a new bounding box that bounds a rotated version of
this bounding box by the given radians.  The new bounding box
is still aligned with the axes, of course.


assert(len(bboxes))<EOL>if len(bboxes) == <NUM_LIT:1>:<EOL><INDENT>return bboxes[<NUM_LIT:0>]<EOL><DEDENT>x0 = np.inf<EOL>y0 = np.inf<EOL>x1 = -np.inf<EOL>y1 = -np.inf<EOL>for bbox in bboxes:<EOL><INDENT>points = bbox.get_points()<EOL>xs = points[:, <NUM_LIT:0>]<EOL>ys = points[:, <NUM_LIT:1>]<EOL>x0 = min(x0, np.min(xs))<EOL>y0 = min(y0, np.min(ys))<EOL>x1 = max(x1, np.max(xs))<EOL>y1 = max(y1, np.max(ys))<EOL><DEDENT>return Bbox.from_extents(x0, y0, x1, y1)<EOL>

Return a :class:`Bbox` that contains all of the given bboxes.


BboxBase.__init__(self)<EOL>self._points = np.asarray(points, np.float_)<EOL>self._minpos = np.array([<NUM_LIT>, <NUM_LIT>])<EOL>self._ignore = True<EOL>

*points*: a 2x2 numpy array of the form [[x0, y0], [x1, y1]]

If you need to create a :class:`Bbox` object from another form
of data, consider the static methods :meth:`unit`,
:meth:`from_bounds` and :meth:`from_extents`.


return Bbox(Bbox._unit_values.copy())<EOL>

(staticmethod) Create a new unit :class:`Bbox` from (0, 0) to
(1, 1).


return Bbox.from_extents(x0, y0, x0 + width, y0 + height)<EOL>

(staticmethod) Create a new :class:`Bbox` from *x0*, *y0*,
*width* and *height*.

*width* and *height* may be negative.


points = np.array(args, dtype=np.float_).reshape(<NUM_LIT:2>, <NUM_LIT:2>)<EOL>return Bbox(points)<EOL>

(staticmethod) Create a new Bbox from *left*, *bottom*,
*right* and *top*.

The *y*-axis increases upwards.


self._ignore = value<EOL>

Set whether the existing bounds of the box should be ignored
by subsequent calls to :meth:`update_from_data` or
:meth:`update_from_data_xy`.

*value*:

   - When True, subsequent calls to :meth:`update_from_data`
     will ignore the existing bounds of the :class:`Bbox`.

   - When False, subsequent calls to :meth:`update_from_data`
     will include the existing bounds of the :class:`Bbox`.


def update_from_data(self, x, y, ignore=None):

warnings.warn(<EOL>"<STR_LIT>")<EOL>xy = np.hstack((x.reshape((len(x), <NUM_LIT:1>)), y.reshape((len(y), <NUM_LIT:1>))))<EOL>return self.update_from_data_xy(xy, ignore)<EOL>

Update the bounds of the :class:`Bbox` based on the passed in
data.  After updating, the bounds will have positive *width*
and *height*; *x0* and *y0* will be the minimal values.

*x*: a numpy array of *x*-values

*y*: a numpy array of *y*-values

*ignore*:
   - when True, ignore the existing bounds of the :class:`Bbox`.
   - when False, include the existing bounds of the :class:`Bbox`.
   - when None, use the last value passed to :meth:`ignore`.


def update_from_path(self, path, ignore=None, updatex=True, updatey=True):

if ignore is None:<EOL><INDENT>ignore = self._ignore<EOL><DEDENT>if path.vertices.size == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>points, minpos, changed = update_path_extents(<EOL>path, None, self._points, self._minpos, ignore)<EOL>if changed:<EOL><INDENT>self.invalidate()<EOL>if updatex:<EOL><INDENT>self._points[:,<NUM_LIT:0>] = points[:,<NUM_LIT:0>]<EOL>self._minpos[<NUM_LIT:0>] = minpos[<NUM_LIT:0>]<EOL><DEDENT>if updatey:<EOL><INDENT>self._points[:,<NUM_LIT:1>] = points[:,<NUM_LIT:1>]<EOL>self._minpos[<NUM_LIT:1>] = minpos[<NUM_LIT:1>]<EOL><DEDENT><DEDENT>

Update the bounds of the :class:`Bbox` based on the passed in
data.  After updating, the bounds will have positive *width*
and *height*; *x0* and *y0* will be the minimal values.

*path*: a :class:`~matplotlib.path.Path` instance

*ignore*:
   - when True, ignore the existing bounds of the :class:`Bbox`.
   - when False, include the existing bounds of the :class:`Bbox`.
   - when None, use the last value passed to :meth:`ignore`.

*updatex*: when True, update the x values

*updatey*: when True, update the y values


def update_from_data_xy(self, xy, ignore=None, updatex=True, updatey=True):

if len(xy) == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>path = Path(xy)<EOL>self.update_from_path(path, ignore=ignore,<EOL>updatex=updatex, updatey=updatey)<EOL>

Update the bounds of the :class:`Bbox` based on the passed in
data.  After updating, the bounds will have positive *width*
and *height*; *x0* and *y0* will be the minimal values.

*xy*: a numpy array of 2D points

*ignore*:
   - when True, ignore the existing bounds of the :class:`Bbox`.
   - when False, include the existing bounds of the :class:`Bbox`.
   - when None, use the last value passed to :meth:`ignore`.

*updatex*: when True, update the x values

*updatey*: when True, update the y values


self._invalid = <NUM_LIT:0><EOL>return self._points<EOL>

Get the points of the bounding box directly as a numpy array
of the form: [[x0, y0], [x1, y1]].


if np.any(self._points != points):<EOL><INDENT>self._points = points<EOL>self.invalidate()<EOL><DEDENT>

Set the points of the bounding box directly from a numpy array
of the form: [[x0, y0], [x1, y1]].  No error checking is
performed, as this method is mainly for internal use.


if np.any(self._points != other.get_points()):<EOL><INDENT>self._points = other.get_points()<EOL>self.invalidate()<EOL><DEDENT>

Set this bounding box from the "frozen" bounds of another
:class:`Bbox`.


assert bbox.is_bbox<EOL>assert isinstance(transform, Transform)<EOL>assert transform.input_dims == <NUM_LIT:2><EOL>assert transform.output_dims == <NUM_LIT:2><EOL>BboxBase.__init__(self)<EOL>self._bbox = bbox<EOL>self._transform = transform<EOL>self.set_children(bbox, transform)<EOL>self._points = None<EOL>

*bbox*: a child :class:`Bbox`

*transform*: a 2D :class:`Transform`


if isinstance(other, Transform):<EOL><INDENT>return composite_transform_factory(self, other)<EOL><DEDENT>raise TypeError(<EOL>"<STR_LIT>" % type(other))<EOL>

Composes two transforms together such that *self* is followed
by *other*.


if isinstance(other, Transform):<EOL><INDENT>return composite_transform_factory(other, self)<EOL><DEDENT>raise TypeError(<EOL>"<STR_LIT>" % type(other))<EOL>


return self.frozen().__array__()<EOL>

Used by C/C++ -based backends to get at the array matrix data.


raise NotImplementedError()<EOL>

Performs the transformation on the given array of values.

Accepts a numpy array of shape (N x :attr:`input_dims`) and
returns a numpy array of shape (N x :attr:`output_dims`).


return values<EOL>

Performs only the affine part of this transformation on the
given array of values.

``transform(values)`` is always equivalent to
``transform_affine(transform_non_affine(values))``.

In non-affine transformations, this is generally a no-op.  In
affine transformations, this is equivalent to
``transform(values)``.

Accepts a numpy array of shape (N x :attr:`input_dims`) and
returns a numpy array of shape (N x :attr:`output_dims`).


return self.transform(values)<EOL>

Performs only the non-affine part of the transformation.

``transform(values)`` is always equivalent to
``transform_affine(transform_non_affine(values))``.

In non-affine transformations, this is generally equivalent to
``transform(values)``.  In affine transformations, this is
always a no-op.

Accepts a numpy array of shape (N x :attr:`input_dims`) and
returns a numpy array of shape (N x :attr:`output_dims`).


return IdentityTransform()<EOL>


assert len(point) == self.input_dims<EOL>return self.transform(np.asarray([point]))[<NUM_LIT:0>]<EOL>

A convenience function that returns the transformed copy of a
single point.

The point is given as a sequence of length :attr:`input_dims`.
The transformed point is returned as a sequence of length
:attr:`output_dims`.


return Path(self.transform(path.vertices), path.codes)<EOL>

Returns a transformed copy of path.

*path*: a :class:`~matplotlib.path.Path` instance.

In some cases, this transform may insert curves into the path
that began as line segments.


return path<EOL>

Returns a copy of path, transformed only by the affine part of
this transform.

*path*: a :class:`~matplotlib.path.Path` instance.

``transform_path(path)`` is equivalent to
``transform_path_affine(transform_path_non_affine(values))``.


return Path(self.transform_non_affine(path.vertices), path.codes)<EOL>

Returns a copy of path, transformed only by the non-affine
part of this transform.

*path*: a :class:`~matplotlib.path.Path` instance.

``transform_path(path)`` is equivalent to
``transform_path_affine(transform_path_non_affine(values))``.


def transform_angles(self, angles, pts, radians=False, pushoff=<NUM_LIT>):

<EOL>if self.input_dims != <NUM_LIT:2> or self.output_dims != <NUM_LIT:2>:<EOL><INDENT>raise NotImplementedError('<STR_LIT>')<EOL><DEDENT>assert pts.shape[<NUM_LIT:1>] == <NUM_LIT:2><EOL>assert np.prod(angles.shape) == angles.shape[<NUM_LIT:0>] == pts.shape[<NUM_LIT:0>]<EOL>if not radians:<EOL><INDENT>angles = angles / <NUM_LIT> * np.pi<EOL><DEDENT>pts2 = pts + pushoff * np.c_[ np.cos(angles), np.sin(angles) ]<EOL>tpts = self.transform( pts )<EOL>tpts2 = self.transform( pts2 )<EOL>d = tpts2 - tpts<EOL>a = np.arctan2( d[:,<NUM_LIT:1>], d[:,<NUM_LIT:0>] )<EOL>if not radians:<EOL><INDENT>a = a * <NUM_LIT> / np.pi<EOL><DEDENT>return a<EOL>

Performs transformation on a set of angles anchored at
specific locations.

The *angles* must be a column vector (i.e., numpy array).

The *pts* must be a two-column numpy array of x,y positions
(angle transforms currently only work in 2D).  This array must
have the same number of rows as *angles*.

*radians* indicates whether or not input angles are given in
 radians (True) or degrees (False; the default).

*pushoff* is the distance to move away from *pts* for
 determining transformed angles (see discussion of method
 below).

The transformed angles are returned in an array with the same
size as *angles*.

The generic version of this method uses a very generic
algorithm that transforms *pts*, as well as locations very
close to *pts*, to find the angle in the transformed system.


raise NotImplementedError()<EOL>

Return the corresponding inverse transformation.

The return value of this method should be treated as
temporary.  An update to *self* does not cause a corresponding
update to its inverted copy.

``x === self.inverted().transform(self.transform(x))``


assert isinstance(child, Transform)<EOL>Transform.__init__(self)<EOL>self.input_dims = child.input_dims<EOL>self.output_dims = child.output_dims<EOL>self._set(child)<EOL>self._invalid = <NUM_LIT:0><EOL>

*child*: A class:`Transform` instance.  This child may later
be replaced with :meth:`set`.


assert child.input_dims == self.input_dims<EOL>assert child.output_dims == self.output_dims<EOL>self._set(child)<EOL>self._invalid = <NUM_LIT:0><EOL>self.invalidate()<EOL>self._invalid = <NUM_LIT:0><EOL>

Replace the current child of this transform with another one.

The new child must have the same number of input and output
dimensions as the current child.


return np.dot(b, a)<EOL>

Concatenates two transformation matrices (represented as numpy
arrays) together.


raise NotImplementedError()<EOL>

Get the underlying transformation matrix as a numpy array.


mtx = self.get_matrix()<EOL>return tuple(mtx[:<NUM_LIT:2>].swapaxes(<NUM_LIT:0>, <NUM_LIT:1>).flatten())<EOL>

Return the values of the matrix as a sequence (a,b,c,d,e,f)


def matrix_from_values(a, b, c, d, e, f):

return np.array([[a, c, e], [b, d, f], [<NUM_LIT:0.0>, <NUM_LIT:0.0>, <NUM_LIT:1.0>]], np.float_)<EOL>

(staticmethod) Create a new transformation matrix as a 3x3
numpy array of the form::

  a c e
  b d f
  0 0 1


Affine2DBase.__init__(self)<EOL>if matrix is None:<EOL><INDENT>matrix = np.identity(<NUM_LIT:3>)<EOL><DEDENT>elif DEBUG:<EOL><INDENT>matrix = np.asarray(matrix, np.float_)<EOL>assert matrix.shape == (<NUM_LIT:3>, <NUM_LIT:3>)<EOL><DEDENT>self._mtx = matrix<EOL>self._invalid = <NUM_LIT:0><EOL>

Initialize an Affine transform from a 3x3 numpy float array::

  a c e
  b d f
  0 0 1

If *matrix* is None, initialize with the identity transform.


return Affine2D(<EOL>np.array([a, c, e, b, d, f, <NUM_LIT:0.0>, <NUM_LIT:0.0>, <NUM_LIT:1.0>], np.float_)<EOL>.reshape((<NUM_LIT:3>,<NUM_LIT:3>)))<EOL>

(staticmethod) Create a new Affine2D instance from the given
values::

  a c e
  b d f
  0 0 1


self._invalid = <NUM_LIT:0><EOL>return self._mtx<EOL>

Get the underlying transformation matrix as a 3x3 numpy array::

  a c e
  b d f
  0 0 1


self._mtx = mtx<EOL>self.invalidate()<EOL>

Set the underlying transformation matrix from a 3x3 numpy array::

  a c e
  b d f
  0 0 1


assert isinstance(other, Affine2DBase)<EOL>self._mtx = other.get_matrix()<EOL>self.invalidate()<EOL>

Set this transformation from the frozen copy of another
:class:`Affine2DBase` object.


return Affine2D(np.identity(<NUM_LIT:3>))<EOL>

(staticmethod) Return a new :class:`Affine2D` object that is
the identity transform.

Unless this transform will be mutated later on, consider using
the faster :class:`IdentityTransform` class instead.


self._mtx = np.identity(<NUM_LIT:3>)<EOL>self.invalidate()<EOL>return self<EOL>

Reset the underlying matrix to the identity transform.


a = np.cos(theta)<EOL>b = np.sin(theta)<EOL>rotate_mtx = np.array(<EOL>[[a, -b, <NUM_LIT:0.0>], [b, a, <NUM_LIT:0.0>], [<NUM_LIT:0.0>, <NUM_LIT:0.0>, <NUM_LIT:1.0>]],<EOL>np.float_)<EOL>self._mtx = np.dot(rotate_mtx, self._mtx)<EOL>self.invalidate()<EOL>return self<EOL>

Add a rotation (in radians) to this transform in place.

Returns *self*, so this method can easily be chained with more
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
and :meth:`scale`.


return self.rotate(degrees*np.pi/<NUM_LIT>)<EOL>

Add a rotation (in degrees) to this transform in place.

Returns *self*, so this method can easily be chained with more
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
and :meth:`scale`.


return self.translate(-x, -y).rotate(theta).translate(x, y)<EOL>

Add a rotation (in radians) around the point (x, y) in place.

Returns *self*, so this method can easily be chained with more
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
and :meth:`scale`.


def rotate_deg_around(self, x, y, degrees):

return self.translate(-x, -y).rotate_deg(degrees).translate(x, y)<EOL>

Add a rotation (in degrees) around the point (x, y) in place.

Returns *self*, so this method can easily be chained with more
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
and :meth:`scale`.


translate_mtx = np.array(<EOL>[[<NUM_LIT:1.0>, <NUM_LIT:0.0>, tx], [<NUM_LIT:0.0>, <NUM_LIT:1.0>, ty], [<NUM_LIT:0.0>, <NUM_LIT:0.0>, <NUM_LIT:1.0>]],<EOL>np.float_)<EOL>self._mtx = np.dot(translate_mtx, self._mtx)<EOL>self.invalidate()<EOL>return self<EOL>

Adds a translation in place.

Returns *self*, so this method can easily be chained with more
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
and :meth:`scale`.


if sy is None:<EOL><INDENT>sy = sx<EOL><DEDENT>scale_mtx = np.array(<EOL>[[sx, <NUM_LIT:0.0>, <NUM_LIT:0.0>], [<NUM_LIT:0.0>, sy, <NUM_LIT:0.0>], [<NUM_LIT:0.0>, <NUM_LIT:0.0>, <NUM_LIT:1.0>]],<EOL>np.float_)<EOL>self._mtx = np.dot(scale_mtx, self._mtx)<EOL>self.invalidate()<EOL>return self<EOL>

Adds a scale in place.

If *sy* is None, the same scale is applied in both the *x*- and
*y*-directions.

Returns *self*, so this method can easily be chained with more
calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
and :meth:`scale`.


def __init__(self, x_transform, y_transform):

<EOL>Transform.__init__(self)<EOL>self._x = x_transform<EOL>self._y = y_transform<EOL>self.set_children(x_transform, y_transform)<EOL>self._affine = None<EOL>

Create a new "blended" transform using *x_transform* to
transform the *x*-axis and *y_transform* to transform the
*y*-axis.

You will generally not call this constructor directly but use
the :func:`blended_transform_factory` function instead, which
can determine automatically which kind of blended transform to
create.


assert x_transform.is_affine<EOL>assert y_transform.is_affine<EOL>assert x_transform.is_separable<EOL>assert y_transform.is_separable<EOL>Transform.__init__(self)<EOL>self._x = x_transform<EOL>self._y = y_transform<EOL>self.set_children(x_transform, y_transform)<EOL>Affine2DBase.__init__(self)<EOL>self._mtx = None<EOL>

Create a new "blended" transform using *x_transform* to
transform the *x*-axis and *y_transform* to transform the
*y*-axis.

Both *x_transform* and *y_transform* must be 2D affine
transforms.

You will generally not call this constructor directly but use
the :func:`blended_transform_factory` function instead, which
can determine automatically which kind of blended transform to
create.


assert a.output_dims == b.input_dims<EOL>self.input_dims = a.input_dims<EOL>self.output_dims = b.output_dims<EOL>Transform.__init__(self)<EOL>self._a = a<EOL>self._b = b<EOL>self.set_children(a, b)<EOL>

Create a new composite transform that is the result of
applying transform *a* then transform *b*.

You will generally not call this constructor directly but use
the :func:`composite_transform_factory` function instead,
which can automatically choose the best kind of composite
transform instance to create.


assert a.output_dims == b.input_dims<EOL>self.input_dims = a.input_dims<EOL>self.output_dims = b.output_dims<EOL>assert a.is_affine<EOL>assert b.is_affine<EOL>Affine2DBase.__init__(self)<EOL>self._a = a<EOL>self._b = b<EOL>self.set_children(a, b)<EOL>self._mtx = None<EOL>

Create a new composite transform that is the result of
applying transform *a* then transform *b*.

Both *a* and *b* must be instances of :class:`Affine2DBase`.

You will generally not call this constructor directly but use
the :func:`composite_transform_factory` function instead,
which can automatically choose the best kind of composite
transform instance to create.


assert boxin.is_bbox<EOL>assert boxout.is_bbox<EOL>Affine2DBase.__init__(self)<EOL>self._boxin = boxin<EOL>self._boxout = boxout<EOL>self.set_children(boxin, boxout)<EOL>self._mtx = None<EOL>self._inverted = None<EOL>

Create a new :class:`BboxTransform` that linearly transforms
points from *boxin* to *boxout*.


assert boxout.is_bbox<EOL>Affine2DBase.__init__(self)<EOL>self._boxout = boxout<EOL>self.set_children(boxout)<EOL>self._mtx = None<EOL>self._inverted = None<EOL>

Create a new :class:`BboxTransformTo` that linearly transforms
points from the unit bounding box to *boxout*.


assert isinstance(transform, Transform)<EOL>TransformNode.__init__(self)<EOL>self._path = path<EOL>self._transform = transform<EOL>self.set_children(transform)<EOL>self._transformed_path = None<EOL>self._transformed_points = None<EOL>

Create a new :class:`TransformedPath` from the given
:class:`~matplotlib.path.Path` and :class:`Transform`.


self._revalidate()<EOL>return self._transformed_points, self.get_affine()<EOL>

Return a copy of the child path, with the non-affine part of
the transform already applied, along with the affine part of
the path necessary to complete the transformation.  Unlike
:meth:`get_transformed_path_and_affine`, no interpolation will
be performed.


self._revalidate()<EOL>return self._transformed_path, self.get_affine()<EOL>

Return a copy of the child path, with the non-affine part of
the transform already applied, along with the affine part of
the path necessary to complete the transformation.


if ((self._invalid & self.INVALID_NON_AFFINE == self.INVALID_NON_AFFINE)<EOL>or self._transformed_path is None):<EOL><INDENT>self._transformed_path =self._transform.transform_path_non_affine(self._path)<EOL><DEDENT>self._invalid = <NUM_LIT:0><EOL>return self._transform.transform_path_affine(self._transformed_path)<EOL>

Return a fully-transformed copy of the child path.


mask = a <= <NUM_LIT:0.0><EOL>if mask.any():<EOL><INDENT>return ma.MaskedArray(a, mask=mask)<EOL><DEDENT>return a<EOL>

Return a Numpy masked array where all non-positive values are
masked.  If there are no non-positive values, the original array
is returned.


def scale_factory(scale, axis, **kwargs):

scale = scale.lower()<EOL>if scale is None:<EOL><INDENT>scale = '<STR_LIT>'<EOL><DEDENT>if scale not in _scale_mapping:<EOL><INDENT>raise ValueError("<STR_LIT>" % scale)<EOL><DEDENT>return _scale_mapping[scale](axis, **kwargs)<EOL>

Return a scale class by name.

ACCEPTS: [ %(names)s ]


_scale_mapping[scale_class.name] = scale_class<EOL>

Register a new kind of scale.

*scale_class* must be a subclass of :class:`ScaleBase`.


docs = []<EOL>for name in get_scale_names():<EOL><INDENT>scale_class = _scale_mapping[name]<EOL>docs.append("<STR_LIT>" % name)<EOL>docs.append("<STR_LIT>")<EOL>class_docs = dedent(scale_class.__init__.__doc__)<EOL>class_docs = "<STR_LIT>".join(["<STR_LIT>" %<EOL>x for x in class_docs.split("<STR_LIT:\n>")])<EOL>docs.append(class_docs)<EOL>docs.append("<STR_LIT>")<EOL><DEDENT>return "<STR_LIT:\n>".join(docs)<EOL>

Helper function for generating docstrings related to scales.


raise NotImplementedError<EOL>

Return the :class:`~matplotlib.transforms.Transform` object
associated with this scale.


raise NotImplementedError<EOL>

Set the :class:`~matplotlib.ticker.Locator` and
:class:`~matplotlib.ticker.Formatter` objects on the given
axis to match this scale.


def limit_range_for_scale(self, vmin, vmax, minpos):

return vmin, vmax<EOL>

Returns the range *vmin*, *vmax*, possibly limited to the
domain supported by this scale.

*minpos* should be the minimum positive value in the data.
 This is used by log scales to determine a minimum value.


axis.set_major_locator(AutoLocator())<EOL>axis.set_major_formatter(ScalarFormatter())<EOL>axis.set_minor_locator(NullLocator())<EOL>axis.set_minor_formatter(NullFormatter())<EOL>

Set the locators and formatters to reasonable defaults for
linear scaling.


return IdentityTransform()<EOL>

The transform for linear scaling is just the
:class:`~matplotlib.transforms.IdentityTransform`.


if axis.axis_name == '<STR_LIT:x>':<EOL><INDENT>base = kwargs.pop('<STR_LIT>', <NUM_LIT>)<EOL>subs = kwargs.pop('<STR_LIT>', None)<EOL><DEDENT>else:<EOL><INDENT>base = kwargs.pop('<STR_LIT>', <NUM_LIT>)<EOL>subs = kwargs.pop('<STR_LIT>', None)<EOL><DEDENT>if base == <NUM_LIT>:<EOL><INDENT>self._transform = self.Log10Transform()<EOL><DEDENT>elif base == <NUM_LIT>:<EOL><INDENT>self._transform = self.Log2Transform()<EOL><DEDENT>elif base == np.e:<EOL><INDENT>self._transform = self.NaturalLogTransform()<EOL><DEDENT>else:<EOL><INDENT>self._transform = self.LogTransform(base)<EOL><DEDENT>self.base = base<EOL>self.subs = subs<EOL>

*basex*/*basey*:
   The base of the logarithm

*subsx*/*subsy*:
   Where to place the subticks between each major tick.
   Should be a sequence of integers.  For example, in a log10
   scale: ``[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]``

   will place 10 logarithmically spaced minor ticks between
   each major tick.


Set the locators and formatters to specialized versions for
log scaling.


return self._transform<EOL>

Return a :class:`~matplotlib.transforms.Transform` instance
appropriate for the given logarithm base.


return (vmin <= <NUM_LIT:0.0> and minpos or vmin,<EOL>vmax <= <NUM_LIT:0.0> and minpos or vmax)<EOL>


if axis.axis_name == '<STR_LIT:x>':<EOL><INDENT>base = kwargs.pop('<STR_LIT>', <NUM_LIT>)<EOL>linthresh = kwargs.pop('<STR_LIT>', <NUM_LIT>)<EOL>subs = kwargs.pop('<STR_LIT>', None)<EOL><DEDENT>else:<EOL><INDENT>base = kwargs.pop('<STR_LIT>', <NUM_LIT>)<EOL>linthresh = kwargs.pop('<STR_LIT>', <NUM_LIT>)<EOL>subs = kwargs.pop('<STR_LIT>', None)<EOL><DEDENT>self._transform = self.SymmetricalLogTransform(base, linthresh)<EOL>self.base = base<EOL>self.linthresh = linthresh<EOL>self.subs = subs<EOL>

*basex*/*basey*:
   The base of the logarithm

*linthreshx*/*linthreshy*:
  The range (-*x*, *x*) within which the plot is linear (to
  avoid having the plot go to infinity around zero).

*subsx*/*subsy*:
   Where to place the subticks between each major tick.
   Should be a sequence of integers.  For example, in a log10
   scale: ``[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]``

   will place 10 logarithmically spaced minor ticks between
   each major tick.


Set the locators and formatters to specialized versions for
symmetrical log scaling.


return self._transform<EOL>

Return a :class:`SymmetricalLogTransform` instance.


if name is None: name = mpl.rcParams['<STR_LIT>']<EOL>if lut is None: lut = mpl.rcParams['<STR_LIT>']<EOL>assert(name in datad.keys())<EOL>return colors.LinearSegmentedColormap(name,  datad[name], lut)<EOL>

Get a colormap instance, defaulting to rc values if *name* is None


def __init__(self, norm=None, cmap=None):

self.callbacksSM = cbook.CallbackRegistry((<EOL>'<STR_LIT>',))<EOL>if cmap is None: cmap = get_cmap()<EOL>if norm is None: norm = colors.Normalize()<EOL>self._A = None<EOL>self.norm = norm<EOL>self.cmap = cmap<EOL>self.colorbar = None<EOL>self.update_dict = {'<STR_LIT>':False}<EOL>

*norm* is an instance of :class:`colors.Normalize` or one of
its subclasses, used to map luminance to 0-1. *cmap* is a
:mod:`cm` colormap instance, for example :data:`cm.jet`


self.colorbar = im, ax<EOL>

set the colorbar image and axes associated with mappable


def to_rgba(self, x, alpha=<NUM_LIT:1.0>, bytes=False):

try:<EOL><INDENT>if x.ndim == <NUM_LIT:3>:<EOL><INDENT>if x.shape[<NUM_LIT:2>] == <NUM_LIT:3>:<EOL><INDENT>if x.dtype == np.uint8:<EOL><INDENT>alpha = np.array(alpha*<NUM_LIT:255>, np.uint8)<EOL><DEDENT>m, n = x.shape[:<NUM_LIT:2>]<EOL>xx = np.empty(shape=(m,n,<NUM_LIT:4>), dtype = x.dtype)<EOL>xx[:,:,:<NUM_LIT:3>] = x<EOL>xx[:,:,<NUM_LIT:3>] = alpha<EOL><DEDENT>elif x.shape[<NUM_LIT:2>] == <NUM_LIT:4>:<EOL><INDENT>xx = x<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if bytes and xx.dtype != np.uint8:<EOL><INDENT>xx = (xx * <NUM_LIT:255>).astype(np.uint8)<EOL><DEDENT>return xx<EOL><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>x = ma.asarray(x)<EOL>x = self.norm(x)<EOL>x = self.cmap(x, alpha=alpha, bytes=bytes)<EOL>return x<EOL>

Return a normalized rgba array corresponding to *x*. If *x*
        is already an rgb array, insert *alpha*; if it is already
        rgba, return it unchanged. If *bytes* is True, return rgba as
        4 uint8s instead of 4 floats.


self._A = A<EOL>self.update_dict['<STR_LIT>'] = True<EOL>

Set the image array from numpy array *A*


return self._A<EOL>


return self.cmap<EOL>


return self.norm.vmin, self.norm.vmax<EOL>

return the min, max of the color limits for image scaling


def set_clim(self, vmin=None, vmax=None):

if (vmin is not None and vmax is None and<EOL>cbook.iterable(vmin) and len(vmin)==<NUM_LIT:2>):<EOL><INDENT>vmin, vmax = vmin<EOL><DEDENT>if vmin is not None: self.norm.vmin = vmin<EOL>if vmax is not None: self.norm.vmax = vmax<EOL>self.changed()<EOL>

set the norm limits for image scaling; if *vmin* is a length2
sequence, interpret it as ``(vmin, vmax)`` which is used to
support setp

ACCEPTS: a length 2 sequence of floats


if cmap is None: cmap = get_cmap()<EOL>self.cmap = cmap<EOL>self.changed()<EOL>

set the colormap for luminance data

ACCEPTS: a colormap


if norm is None: norm = colors.Normalize()<EOL>self.norm = norm<EOL>self.changed()<EOL>


if self._A is None:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>self.norm.autoscale(self._A)<EOL>self.changed()<EOL>

Autoscale the scalar limits on the norm instance using the
current array


if self._A is None:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>self.norm.autoscale_None(self._A)<EOL>self.changed()<EOL>

Autoscale the scalar limits on the norm instance using the
current array, changing only limits that are None


self.update_dict[checker] = False<EOL>

Add an entry to a dictionary of boolean flags
that are set to True when the mappable is changed.


if self.update_dict[checker]:<EOL><INDENT>self.update_dict[checker] = False<EOL>return True<EOL><DEDENT>return False<EOL>

If mappable has changed since the last check,
return True; else return False


self.callbacksSM.process('<STR_LIT>', self)<EOL>for key in self.update_dict:<EOL><INDENT>self.update_dict[key] = True<EOL><DEDENT>

Call this whenever the mappable is changed to notify all the
callbackSM listeners to the 'changed' signal


if hasattr(dt, '<STR_LIT>') and dt.tzinfo is not None:<EOL><INDENT>delta = dt.tzinfo.utcoffset(dt)<EOL>if delta is not None:<EOL><INDENT>dt -= delta<EOL><DEDENT><DEDENT>base =  float(dt.toordinal())<EOL>if hasattr(dt, '<STR_LIT>'):<EOL><INDENT>base += (dt.hour/HOURS_PER_DAY + dt.minute/MINUTES_PER_DAY +<EOL>dt.second/SECONDS_PER_DAY + dt.microsecond/MUSECONDS_PER_DAY<EOL>)<EOL><DEDENT>return base<EOL>

Convert :mod:`datetime` to the Gregorian date as UTC float days,
preserving hours, minutes, seconds and microseconds.  Return value
is a :func:`float`.


if tz is None: tz = _get_rc_timezone()<EOL>ix = int(x)<EOL>dt = datetime.datetime.fromordinal(ix)<EOL>remainder = float(x) - ix<EOL>hour, remainder = divmod(<NUM_LIT>*remainder, <NUM_LIT:1>)<EOL>minute, remainder = divmod(<NUM_LIT>*remainder, <NUM_LIT:1>)<EOL>second, remainder = divmod(<NUM_LIT>*remainder, <NUM_LIT:1>)<EOL>microsecond = int(<NUM_LIT>*remainder)<EOL>if microsecond<<NUM_LIT:10>: microsecond=<NUM_LIT:0> <EOL>dt = datetime.datetime(<EOL>dt.year, dt.month, dt.day, int(hour), int(minute), int(second),<EOL>microsecond, tzinfo=UTC).astimezone(tz)<EOL>if microsecond><NUM_LIT>:  <EOL><INDENT>dt += datetime.timedelta(microseconds=<NUM_LIT>-microsecond)<EOL><DEDENT>return dt<EOL>

Convert Gregorian float of the date, preserving hours, minutes,
seconds and microseconds.  Return value is a :class:`datetime`.


if not cbook.iterable(d): return _to_ordinalf(d)<EOL>else: return np.asarray([_to_ordinalf(val) for val in d])<EOL>

*d* is either a :class:`datetime` instance or a sequence of datetimes.

Return value is a floating point number (or sequence of floats)
which gives number of days (fraction part represents hours,
minutes, seconds) since 0001-01-01 00:00:00 UTC.


if cbook.iterable(j): j = np.asarray(j)<EOL>return j + <NUM_LIT><EOL>

Convert a Julian date (or sequence) to a matplotlib date (or sequence).


if cbook.iterable(n): n = np.asarray(n)<EOL>return n - <NUM_LIT><EOL>

Convert a matplotlib date (or sequence) to a Julian date (or sequence).


if tz is None: tz = _get_rc_timezone()<EOL>if not cbook.iterable(x): return _from_ordinalf(x, tz)<EOL>else: return [_from_ordinalf(val, tz) for val in x]<EOL>

*x* is a float value which gives number of days (fraction part
represents hours, minutes, seconds) since 0001-01-01 00:00:00 UTC.

Return value is a :class:`datetime` instance in timezone *tz* (default to
rcparams TZ value).

If *x* is a sequence, a sequence of :class:`datetime` objects will
be returned.


step = (delta.days + delta.seconds/SECONDS_PER_DAY +<EOL>delta.microseconds/MUSECONDS_PER_DAY)<EOL>f1 = _to_ordinalf(dstart)<EOL>f2 = _to_ordinalf(dend)<EOL>return np.arange(f1, f2, step)<EOL>

Return a date range as float Gregorian ordinals.  *dstart* and
*dend* are :class:`datetime` instances.  *delta* is a
:class:`datetime.timedelta` instance.


def _close_to_dt(d1, d2, epsilon=<NUM_LIT:5>):

delta = d2-d1<EOL>mus = abs(delta.days*MUSECONDS_PER_DAY + delta.seconds*<NUM_LIT> +<EOL>delta.microseconds)<EOL>assert(mus<epsilon)<EOL>

Assert that datetimes *d1* and *d2* are within *epsilon* microseconds.


def _close_to_num(o1, o2, epsilon=<NUM_LIT:5>):

delta = abs((o2-o1)*MUSECONDS_PER_DAY)<EOL>assert(delta<epsilon)<EOL>

Assert that float ordinals *o1* and *o2* are within *epsilon* microseconds.


spd = <NUM_LIT>*<NUM_LIT><EOL>return <NUM_LIT> + np.asarray(e)/spd<EOL>

Convert an epoch or sequence of epochs to the new date format,
that is days since 0001.


spd = <NUM_LIT>*<NUM_LIT><EOL>return (np.asarray(d)-<NUM_LIT>)*spd<EOL>

Convert days since 0001 to epoch.  *d* can be a number or sequence.


scalar = False<EOL>if not cbook.iterable(mxdates):<EOL><INDENT>scalar = True<EOL>mxdates = [mxdates]<EOL><DEDENT>ret = epoch2num([m.ticks() for m in mxdates])<EOL>if scalar: return ret[<NUM_LIT:0>]<EOL>else: return ret<EOL>

Convert mx :class:`datetime` instance (or sequence of mx
instances) to the new date format.


def date_ticker_factory(span, tz=None, numticks=<NUM_LIT:5>):

if span==<NUM_LIT:0>: span = <NUM_LIT:1>/<NUM_LIT><EOL>minutes = span*<NUM_LIT>*<NUM_LIT><EOL>hours  = span*<NUM_LIT><EOL>days   = span<EOL>weeks  = span/<NUM_LIT><EOL>months = span/<NUM_LIT> <EOL>years  = span/<NUM_LIT><EOL>if years>numticks:<EOL><INDENT>locator = YearLocator(int(years/numticks), tz=tz)  <EOL>fmt = '<STR_LIT>'<EOL><DEDENT>elif months>numticks:<EOL><INDENT>locator = MonthLocator(tz=tz)<EOL>fmt = '<STR_LIT>'<EOL><DEDENT>elif weeks>numticks:<EOL><INDENT>locator = WeekdayLocator(tz=tz)<EOL>fmt = '<STR_LIT>'<EOL><DEDENT>elif days>numticks:<EOL><INDENT>locator = DayLocator(interval=int(math.ceil(days/numticks)), tz=tz)<EOL>fmt = '<STR_LIT>'<EOL><DEDENT>elif hours>numticks:<EOL><INDENT>locator = HourLocator(interval=int(math.ceil(hours/numticks)), tz=tz)<EOL>fmt = '<STR_LIT>'<EOL><DEDENT>elif minutes>numticks:<EOL><INDENT>locator = MinuteLocator(interval=int(math.ceil(minutes/numticks)), tz=tz)<EOL>fmt = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>locator = MinuteLocator(tz=tz)<EOL>fmt = '<STR_LIT>'<EOL><DEDENT>formatter = DateFormatter(fmt, tz=tz)<EOL>return locator, formatter<EOL>

Create a date locator with *numticks* (approx) and a date formatter
for *span* in days.  Return value is (locator, formatter).


return float(s)/SEC_PER_DAY<EOL>


return float(m)/MINUTES_PER_DAY<EOL>


return h/<NUM_LIT><EOL>


return w*<NUM_LIT><EOL>


self.fmt = fmt<EOL>

fmt: any valid strptime format is supported


return date2num(datetime.datetime(*time.strptime(s, self.fmt)[:<NUM_LIT:6>]))<EOL>

s : string to be converted
           return value: a date2num float


if tz is None: tz = _get_rc_timezone()<EOL>self.fmt = fmt<EOL>self.tz = tz<EOL>

*fmt* is an :func:`strftime` format string; *tz* is the
 :class:`tzinfo` instance.


if tz is None: tz = _get_rc_timezone()<EOL>self.t = t<EOL>self.fmt = fmt<EOL>self.tz = tz<EOL>

*t* is a sequence of dates (floating point days).  *fmt* is a
:func:`strftime` format string.


ind = int(round(x))<EOL>if ind>=len(self.t) or ind<=<NUM_LIT:0>: return '<STR_LIT>'<EOL>dt = num2date(self.t[ind], self.tz)<EOL>return cbook.unicode_safe(dt.strftime(self.fmt))<EOL>

Return the label for time *x* at position *pos*


if tz is None: tz = _get_rc_timezone()<EOL>self.tz = tz<EOL>


return <NUM_LIT:1><EOL>

Return how many days a unit of the locator is; used for
intelligent autoscaling.


freq = self.rule._rrule._freq<EOL>if ( freq == YEARLY ):<EOL><INDENT>return <NUM_LIT><EOL><DEDENT>elif ( freq == MONTHLY ):<EOL><INDENT>return <NUM_LIT:30><EOL><DEDENT>elif ( freq == WEEKLY ):<EOL><INDENT>return <NUM_LIT:7><EOL><DEDENT>elif ( freq == DAILY ):<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT>elif ( freq == HOURLY ):<EOL><INDENT>return (<NUM_LIT:1.0>/<NUM_LIT>)<EOL><DEDENT>elif ( freq == MINUTELY ):<EOL><INDENT>return (<NUM_LIT:1.0>/(<NUM_LIT>*<NUM_LIT>))<EOL><DEDENT>elif ( freq == SECONDLY ):<EOL><INDENT>return (<NUM_LIT:1.0>/(<NUM_LIT>*<NUM_LIT>))<EOL><DEDENT>else:<EOL><INDENT>return -<NUM_LIT:1><EOL><DEDENT>


dmin, dmax = self.datalim_to_dt()<EOL>if dmin>dmax:<EOL><INDENT>dmax, dmin = dmin, dmax<EOL><DEDENT>delta = relativedelta(dmax, dmin)<EOL>self.rule.set(dtstart=dmin-delta, until=dmax+delta)<EOL>dmin, dmax = self.datalim_to_dt()<EOL>vmin = self.rule.before(dmin, True)<EOL>if not vmin: vmin=dmin<EOL>vmax = self.rule.after(dmax, True)<EOL>if not vmax: vmax=dmax<EOL>vmin = date2num(vmin)<EOL>vmax = date2num(vmax)<EOL>return self.nonsingular(vmin, vmax)<EOL>

Set the view limits to include the data range.


self.refresh()<EOL>return self._locator()<EOL>


dmin, dmax = self.viewlim_to_dt()<EOL>self._locator = self.get_locator(dmin, dmax)<EOL>

Refresh internal information based on current limits.


dmin, dmax = self.datalim_to_dt()<EOL>self._locator = self.get_locator(dmin, dmax)<EOL>return self._locator.autoscale()<EOL>

Try to choose the view limits intelligently.


delta = relativedelta(dmax, dmin)<EOL>numYears = (delta.years * <NUM_LIT:1.0>)<EOL>numMonths = (numYears * <NUM_LIT>) + delta.months<EOL>numDays = (numMonths * <NUM_LIT>) + delta.days<EOL>numHours = (numDays * <NUM_LIT>) + delta.hours<EOL>numMinutes = (numHours * <NUM_LIT>) + delta.minutes<EOL>numSeconds = (numMinutes * <NUM_LIT>) + delta.seconds<EOL>numticks = <NUM_LIT:5><EOL>interval = <NUM_LIT:1><EOL>bymonth = <NUM_LIT:1><EOL>bymonthday = <NUM_LIT:1><EOL>byhour = <NUM_LIT:0><EOL>byminute = <NUM_LIT:0><EOL>bysecond = <NUM_LIT:0><EOL>if ( numYears >= numticks ):<EOL><INDENT>self._freq = YEARLY<EOL><DEDENT>elif ( numMonths >= numticks ):<EOL><INDENT>self._freq = MONTHLY<EOL>bymonth = list(range(<NUM_LIT:1>, <NUM_LIT>))<EOL>if ( (<NUM_LIT:0> <= numMonths) and (numMonths <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:1>      <EOL><DEDENT>elif ( (<NUM_LIT:15> <= numMonths) and (numMonths <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:3>      <EOL><DEDENT>elif ( (<NUM_LIT:30> <= numMonths) and (numMonths <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:4>      <EOL><DEDENT>else:   <EOL><INDENT>interval = <NUM_LIT:6>      <EOL><DEDENT><DEDENT>elif ( numDays >= numticks ):<EOL><INDENT>self._freq = DAILY<EOL>bymonth = None<EOL>bymonthday = list(range(<NUM_LIT:1>, <NUM_LIT:32>))<EOL>if ( (<NUM_LIT:0> <= numDays) and (numDays <= <NUM_LIT:9>) ):<EOL><INDENT>interval = <NUM_LIT:1>      <EOL><DEDENT>elif ( (<NUM_LIT:10> <= numDays) and (numDays <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:2>      <EOL><DEDENT>elif ( (<NUM_LIT:20> <= numDays) and (numDays <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:3>      <EOL><DEDENT>elif ( (<NUM_LIT:50> <= numDays) and (numDays <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:7>      <EOL><DEDENT>else:   <EOL><INDENT>interval = <NUM_LIT>     <EOL><DEDENT><DEDENT>elif ( numHours >= numticks ):<EOL><INDENT>self._freq = HOURLY<EOL>bymonth = None<EOL>bymonthday = None<EOL>byhour = list(range(<NUM_LIT:0>, <NUM_LIT>))      <EOL>if ( (<NUM_LIT:0> <= numHours) and (numHours <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:1>      <EOL><DEDENT>elif ( (<NUM_LIT:15> <= numHours) and (numHours <= <NUM_LIT:30>) ):<EOL><INDENT>interval = <NUM_LIT:2>      <EOL><DEDENT>elif ( (<NUM_LIT:30> <= numHours) and (numHours <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:3>      <EOL><DEDENT>elif ( (<NUM_LIT> <= numHours) and (numHours <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:4>      <EOL><DEDENT>elif ( (<NUM_LIT> <= numHours) and (numHours <= <NUM_LIT>) ):<EOL><INDENT>interval = <NUM_LIT:6>      <EOL><DEDENT>else:   <EOL><INDENT>interval = <NUM_LIT:12>     <EOL><DEDENT><DEDENT>elif ( numMinutes >= numticks ):<EOL><INDENT>self._freq = MINUTELY<EOL>bymonth = None<EOL>bymonthday = None<EOL>byhour = None<EOL>byminute = list(range(<NUM_LIT:0>, <NUM_LIT>))<EOL>if ( numMinutes > (<NUM_LIT> * numticks) ):<EOL><INDENT>interval = <NUM_LIT:10><EOL><DEDENT><DEDENT>elif ( numSeconds >= numticks ):<EOL><INDENT>self._freq = SECONDLY<EOL>bymonth = None<EOL>bymonthday = None<EOL>byhour = None<EOL>byminute = None<EOL>bysecond = list(range(<NUM_LIT:0>, <NUM_LIT>))<EOL>if ( numSeconds > (<NUM_LIT> * numticks) ):<EOL><INDENT>interval = <NUM_LIT:10><EOL><DEDENT><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT>rrule = rrulewrapper( self._freq, interval=interval,dtstart=dmin, until=dmax,bymonth=bymonth, bymonthday=bymonthday,byhour=byhour, byminute = byminute,bysecond=bysecond )<EOL>locator = RRuleLocator(rrule, self.tz)<EOL>locator.set_axis(self.axis)<EOL>locator.set_view_interval(*self.axis.get_view_interval())<EOL>locator.set_data_interval(*self.axis.get_data_interval())<EOL>return locator<EOL>

Pick the best locator based on a distance.


def __init__(self, base=<NUM_LIT:1>, month=<NUM_LIT:1>, day=<NUM_LIT:1>, tz=None):

DateLocator.__init__(self, tz)<EOL>self.base = ticker.Base(base)<EOL>self.replaced = { '<STR_LIT>'  : month,<EOL>'<STR_LIT>'    : day,<EOL>'<STR_LIT>'   : <NUM_LIT:0>,<EOL>'<STR_LIT>' : <NUM_LIT:0>,<EOL>'<STR_LIT>' : <NUM_LIT:0>,<EOL>'<STR_LIT>' : tz<EOL>}<EOL>

Mark years that are multiple of base on a given month and day
(default jan 1).


return <NUM_LIT><EOL>


dmin, dmax = self.datalim_to_dt()<EOL>ymin = self.base.le(dmin.year)<EOL>ymax = self.base.ge(dmax.year)<EOL>vmin = dmin.replace(year=ymin, **self.replaced)<EOL>vmax = dmax.replace(year=ymax, **self.replaced)<EOL>vmin = date2num(vmin)<EOL>vmax = date2num(vmax)<EOL>return self.nonsingular(vmin, vmax)<EOL>


def __init__(self,  bymonth=None, bymonthday=<NUM_LIT:1>, interval=<NUM_LIT:1>, tz=None):

if bymonth is None: bymonth=list(range(<NUM_LIT:1>,<NUM_LIT>))<EOL>o = rrulewrapper(MONTHLY, bymonth=bymonth, bymonthday=bymonthday,<EOL>interval=interval, **self.hms0d)<EOL>RRuleLocator.__init__(self, o, tz)<EOL>

Mark every month in *bymonth*; *bymonth* can be an int or
sequence.  Default is ``range(1,13)``, i.e. every month.

*interval* is the interval between each iteration.  For
example, if ``interval=2``, mark every second occurance.


return <NUM_LIT:30><EOL>


def __init__(self,  byweekday=<NUM_LIT:1>, interval=<NUM_LIT:1>, tz=None):

o = rrulewrapper(DAILY, byweekday=byweekday,<EOL>interval=interval, **self.hms0d)<EOL>RRuleLocator.__init__(self, o, tz)<EOL>

Mark every weekday in *byweekday*; *byweekday* can be a number or
sequence.

Elements of *byweekday* must be one of MO, TU, WE, TH, FR, SA,
SU, the constants from :mod:`dateutils.rrule`.

*interval* specifies the number of weeks to skip.  For example,
``interval=2`` plots every second week.


return <NUM_LIT:7><EOL>

return how many days a unit of the locator is; used for
intelligent autoscaling.


def __init__(self,  bymonthday=None, interval=<NUM_LIT:1>, tz=None):

if bymonthday is None: bymonthday=list(range(<NUM_LIT:1>,<NUM_LIT:32>))<EOL>o = rrulewrapper(DAILY, bymonthday=bymonthday,<EOL>interval=interval, **self.hms0d)<EOL>RRuleLocator.__init__(self, o, tz)<EOL>

Mark every day in *bymonthday*; *bymonthday* can be an int or
sequence.

Default is to tick every day of the month: ``bymonthday=range(1,32)``


return <NUM_LIT:1><EOL>