| |
- matplotlib.artist.Artist(__builtin__.object)
-
- QuiverKey
- matplotlib.collections.PolyCollection(matplotlib.collections.Collection)
-
- Barbs
- Quiver
class Barbs(matplotlib.collections.PolyCollection) |
|
Specialized PolyCollection for barbs.
The only API method is set_UVC(), which can be used
to change the size, orientation, and color of the
arrows. Locations are changed using the set_offsets() collection
method.Possibly this method will be useful in animations.
There is one internal function _find_tails() which finds exactly
what should be put on the barb given the vector magnitude. From there
_make_barbs() is used to find the vertices of the polygon to represent the
barb based on this information. |
|
- Method resolution order:
- Barbs
- matplotlib.collections.PolyCollection
- matplotlib.collections.Collection
- matplotlib.artist.Artist
- __builtin__.object
- matplotlib.cm.ScalarMappable
Methods defined here:
- __init__(self, ax, *args, **kw)
- The constructor takes one required argument, an Axes
instance, followed by the args and kwargs described
by the following pylab interface documentation:
Plot a 2-D field of barbs.
call signatures::
barb(U, V, **kw)
barb(U, V, C, **kw)
barb(X, Y, U, V, **kw)
barb(X, Y, U, V, C, **kw)
Arguments:
*X*, *Y*:
The x and y coordinates of the barb locations
(default is head of barb; see *pivot* kwarg)
*U*, *V*:
give the *x* and *y* components of the barb shaft
*C*:
an optional array used to map colors to the barbs
All arguments may be 1-D or 2-D arrays or sequences. If *X* and *Y*
are absent, they will be generated as a uniform grid. If *U* and *V*
are 2-D arrays but *X* and *Y* are 1-D, and if len(*X*) and len(*Y*)
match the column and row dimensions of *U*, then *X* and *Y* will be
expanded with :func:`numpy.meshgrid`.
*U*, *V*, *C* may be masked arrays, but masked *X*, *Y* are not
supported at present.
Keyword arguments:
*length*:
Length of the barb in points; the other parts of the barb
are scaled against this.
Default is 9
*pivot*: [ 'tip' | 'middle' ]
The part of the arrow that is at the grid point; the arrow
rotates about this point, hence the name *pivot*.
Default is 'tip'
*barbcolor*: [ color | color sequence ]
Specifies the color all parts of the barb except any flags.
This parameter is analagous to the *edgecolor* parameter
for polygons, which can be used instead. However this parameter
will override facecolor.
*flagcolor*: [ color | color sequence ]
Specifies the color of any flags on the barb.
This parameter is analagous to the *facecolor* parameter
for polygons, which can be used instead. However this parameter
will override facecolor. If this is not set (and *C* has not either)
then *flagcolor* will be set to match *barbcolor* so that the barb
has a uniform color. If *C* has been set, *flagcolor* has no effect.
*sizes*:
A dictionary of coefficients specifying the ratio of a given feature
to the length of the barb. Only those values one wishes to override
need to be included. These features include:
'spacing' - space between features (flags, full/half barbs)
'height' - height (distance from shaft to top) of a flag or full barb
'width' - width of a flag, twice the width of a full barb
'emptybarb' - radius of the circle used for low magnitudes
*fill_empty*:
A flag on whether the empty barbs (circles) that are drawn should be filled
with the flag color. If they are not filled, they will be drawn such that
no color is applied to the center.
Default is False
*rounding*:
A flag to indicate whether the vector magnitude should be rounded when
allocating barb components. If True, the magnitude is rounded to the
nearest multiple of the half-barb increment. If False, the magnitude
is simply truncated to the next lowest multiple.
Default is True
*barb_increments*:
A dictionary of increments specifying values to associate with different
parts of the barb. Only those values one wishes to override need to be
included.
'half' - half barbs (Default is 5)
'full' - full barbs (Default is 10)
'flag' - flags (default is 50)
*flip_barb*:
Either a single boolean flag or an array of booleans. Single boolean
indicates whether the lines and flags should point opposite to normal
for all barbs. An array (which should be the same size as the other
data arrays) indicates whether to flip for each individual barb.
Normal behavior is for the barbs and lines to point right (comes from
wind barbs having these features point towards low pressure in the
Northern Hemisphere.)
Default is False
Barbs are traditionally used in meteorology as a way to plot the speed
and direction of wind observations, but can technically be used to plot
any two dimensional vector quantity. As opposed to arrows, which give
vector magnitude by the length of the arrow, the barbs give more quantitative
information about the vector magnitude by putting slanted lines or a triangle
for various increments in magnitude, as show schematically below:
/\ / \ / \ \ / \ \ ------------------------------
The largest increment is given by a triangle (or "flag"). After those come full
lines (barbs). The smallest increment is a half line. There is only, of
course, ever at most 1 half line. If the magnitude is small and only needs a
single half-line and no full lines or triangles, the half-line is offset from
the end of the barb so that it can be easily distinguished from barbs with a
single full line. The magnitude for the barb shown above would nominally be
65, using the standard increments of 50, 10, and 5.
linewidths and edgecolors can be used to customize the barb.
Additional :class:`~matplotlib.collections.PolyCollection`
keyword arguments:
============ ======================================================================
Property Description
============ ======================================================================
alpha float
animated [True | False]
antialiased Boolean or sequence of booleans
antialiaseds Boolean or sequence of booleans
array unknown
axes an axes instance
clim a length 2 sequence of floats
clip_box a :class:`matplotlib.transform.Bbox` instance
clip_on [True | False]
clip_path a :class:`~matplotlib.path.Path` instance and a
cmap a colormap
color matplotlib color arg or sequence of rgba tuples
colorbar unknown
contains unknown
dashes ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
edgecolor matplotlib color arg or sequence of rgba tuples
edgecolors matplotlib color arg or sequence of rgba tuples
facecolor matplotlib color arg or sequence of rgba tuples
facecolors matplotlib color arg or sequence of rgba tuples
figure a :class:`matplotlib.figure.Figure` instance
label any string
linestyle ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
linestyles ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
linewidth float or sequence of floats
linewidths float or sequence of floats
lod [True | False]
lw float or sequence of floats
norm unknown
offsets float or sequence of floats
picker [None|float|boolean|callable]
pickradius unknown
transform unknown
visible [True | False]
zorder any number
============ ======================================================================
- set_UVC(self, U, V, C=None)
- set_offsets(self, xy)
- Set the offsets for the collection. *offsets* can be a scalar
or a sequence.
ACCEPTS: float or sequence of floats
Data and other attributes defined here:
- barbs_doc = '\nPlot a 2-D field of barbs.\n\ncall signatures::\n\n...===============================================\n\n'
Methods inherited from matplotlib.collections.PolyCollection:
- draw(self, renderer)
- get_paths(self)
- set_verts(self, verts, closed=True)
- This allows one to delay initialization of the vertices.
Methods inherited from matplotlib.collections.Collection:
- contains(self, mouseevent)
- Test whether the mouse event occurred in the collection.
Returns True | False, ``dict(ind=itemlist)``, where every
item in itemlist contains the event.
- get_dashes = get_linestyles(self)
- get_datalim(self, transData)
- get_edgecolor(self)
- get_edgecolors = get_edgecolor(self)
- get_facecolor(self)
- get_facecolors = get_facecolor(self)
- get_linestyle = get_linestyles(self)
- get_linestyles(self)
- get_linewidth = get_linewidths(self)
- get_linewidths(self)
- get_offsets(self)
- Return the offsets for the collection.
- get_pickradius(self)
- get_transforms(self)
- set_alpha(self, alpha)
- Set the alpha tranparencies of the collection. *alpha* must be
a float.
ACCEPTS: float
- set_antialiased(self, aa)
- Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
- set_antialiaseds = set_antialiased(self, aa)
- Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
- set_color(self, c)
- Set both the edgecolor and the facecolor.
See :meth:`set_facecolor` and :meth:`set_edgecolor`.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
- set_dashes = set_linestyles(self, ls)
- Set the linestyles(s) for the collection.
ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
- set_edgecolor(self, c)
- 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
- set_edgecolors = set_edgecolor(self, c)
- 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
- set_facecolor(self, c)
- 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
- set_facecolors = set_facecolor(self, c)
- 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
- set_linestyle = set_linestyles(self, ls)
- Set the linestyles(s) for the collection.
ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
- set_linestyles(self, ls)
- Set the linestyles(s) for the collection.
ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
- set_linewidth = set_linewidths(self, lw)
- Set the linewidth(s) for the collection. *lw* can be a scalar
or a sequence; if it is a sequence the patches will cycle
through the sequence
ACCEPTS: float or sequence of floats
- set_linewidths(self, lw)
- Set the linewidth(s) for the collection. *lw* can be a scalar
or a sequence; if it is a sequence the patches will cycle
through the sequence
ACCEPTS: float or sequence of floats
- set_lw = set_linewidths(self, lw)
- Set the linewidth(s) for the collection. *lw* can be a scalar
or a sequence; if it is a sequence the patches will cycle
through the sequence
ACCEPTS: float or sequence of floats
- set_pickradius(self, pickradius)
- update_scalarmappable(self)
- If the scalar mappable array is not none, update colors
from scalar data
Data and other attributes inherited from matplotlib.collections.Collection:
- zorder = 1
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- convert_xunits(self, x)
- for artists in an axes, if the xaxis as units support,
convert *x* using xaxis unit type
- convert_yunits(self, y)
- for artists in an axes, if the yaxis as units support,
convert *y* using yaxis unit type
- findobj(self, match=None)
- pyplot signature:
findobj(o=gcf(), match=None)
recursively find all :class:matplotlib.artist.Artist instances
contained in self
*match* can be
- None: return all objects contained in artist (including artist)
- function with signature ``boolean = match(artist)`` used to filter matches
- class instance: eg Line2D. Only return artists of class type
.. plot:: ../mpl_examples/pylab_examples/findobj_demo.py
- get_alpha(self)
- Return the alpha value used for blending - not supported on all
backends
- get_animated(self)
- return the artist's animated state
- get_axes(self)
- return the axes instance the artist resides in, or *None*
- get_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- get_clip_path(self)
- Return artist clip path
- get_contains(self)
- return the _contains test used by the artist, or *None* for default.
- get_figure(self)
- Return the :class:`~matplotlib.figure.Figure` instance the
artist belongs to.
- get_label(self)
- get_picker(self)
- return the Pickeration instance used by this artist
- get_transform(self)
- Return the :class:`~matplotlib.transforms.Transform`
instance used by this artist.
- get_transformed_clip_path_and_affine(self)
- Return the clip path with the non-affine part of its
transformation applied, and the remaining affine part of its
transformation.
- get_visible(self)
- return the artist's visiblity
- get_zorder(self)
- have_units(self)
- return *True* if units are set on the x or y axes
- hitlist(self, event)
- List the children of the artist which contain the mouse event
- is_figure_set(self)
- is_transform_set(self)
- Artist has transform explicity let
- pchanged(self)
- fire event when property changed
- pick(self, mouseevent)
- call signature::
pick(mouseevent)
each child artist will fire a pick event if *mouseevent* is over
the artist and the artist has picker set
- pickable(self)
- return *True* if self is pickable
- remove(self)
- Remove the artist from the figure if possible. The effect
will not be visible until the figure is redrawn, e.g., with
:meth:`matplotlib.axes.Axes.draw_idle`. Call
:meth:`matplotlib.axes.Axes.relim` to update the axes limits
if desired.
Note: :meth:`~matplotlib.axes.Axes.relim` will not see
collections even if the collection was added to axes with
*autolim* = True.
Note: there is no support for removing the artist's legend entry.
- remove_callback(self, oid)
- set(self, **kwargs)
- A tkstyle set command, pass *kwargs* to set properties
- set_animated(self, b)
- set the artist's animation state
ACCEPTS: [True | False]
- set_axes(self, axes)
- set the axes instance in which the artist resides, if any
ACCEPTS: an axes instance
- set_clip_box(self, clipbox)
- Set the artist's clip Bbox
ACCEPTS: a :class:`matplotlib.transform.Bbox` instance
- set_clip_on(self, b)
- Set whether artist uses clipping
ACCEPTS: [True | False]
- set_clip_path(self, path, transform=None)
- Set the artist's clip path, which may be:
* a :class:`~matplotlib.patches.Patch` (or subclass) instance
* a :class:`~matplotlib.path.Path` instance, in which case
an optional :class:`~matplotlib.transforms.Transform`
instance may be provided, which will be applied to the
path before using it for clipping.
* *None*, to remove the clipping path
For efficiency, if the path happens to be an axis-aligned
rectangle, this method will set the clipping box to the
corresponding rectangle and set the clipping path to *None*.
ACCEPTS: a :class:`~matplotlib.path.Path` instance and a
:class:`~matplotlib.transforms.Transform` instance, a
:class:`~matplotlib.patches.Patch` instance, or *None*.
- set_contains(self, picker)
- Replace the contains test used by this artist. The new picker should
be a callable function which determines whether the artist is hit by the
mouse event::
hit, props = picker(artist, mouseevent)
If the mouse event is over the artist, return *hit=True* and *props*
is a dictionary of properties you want returned with the contains test.
- set_figure(self, fig)
- Set the :class:`~matplotlib.figure.Figure` instance the artist
belongs to.
ACCEPTS: a :class:`matplotlib.figure.Figure` instance
- set_label(self, s)
- Set the line label to *s* for auto legend
ACCEPTS: any string
- set_lod(self, on)
- Set Level of Detail on or off. If on, the artists may examine
things like the pixel width of the axes and draw a subset of
their contents accordingly
ACCEPTS: [True | False]
- set_picker(self, picker)
- set the epsilon for picking used by this artist
*picker* can be one of the following:
* *None*: picking is disabled for this artist (default)
* A boolean: if *True* then picking will be enabled and the
artist will fire a pick event if the mouse event is over
the artist
* A float: if picker is a number it is interpreted as an
epsilon tolerance in points and the artist will fire
off an event if it's data is within epsilon of the mouse
event. For some artists like lines and patch collections,
the artist may provide additional data to the pick event
that is generated, e.g. the indices of the data within
epsilon of the pick event
* A function: if picker is callable, it is a user supplied
function which determines whether the artist is hit by the
mouse event::
hit, props = picker(artist, mouseevent)
to determine the hit test. if the mouse event is over the
artist, return *hit=True* and props is a dictionary of
properties you want added to the PickEvent attributes.
ACCEPTS: [None|float|boolean|callable]
- set_transform(self, t)
- Set the :class:`~matplotlib.transforms.Transform` instance
used by this artist.
- set_visible(self, b)
- set the artist's visiblity
ACCEPTS: [True | False]
- set_zorder(self, level)
- Set the zorder for the artist
ACCEPTS: any number
- update(self, props)
- update_from(self, other)
- Copy properties from *other* to *self*.
Data descriptors inherited from matplotlib.artist.Artist:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from matplotlib.artist.Artist:
- aname = 'Artist'
Methods inherited from matplotlib.cm.ScalarMappable:
- add_checker(self, checker)
- Add an entry to a dictionary of boolean flags
that are set to True when the mappable is changed.
- autoscale(self)
- Autoscale the scalar limits on the norm instance using the
current array
- autoscale_None(self)
- Autoscale the scalar limits on the norm instance using the
current array, changing only limits that are None
- changed(self)
- Call this whenever the mappable is changed to notify all the
callbackSM listeners to the 'changed' signal
- check_update(self, checker)
- If mappable has changed since the last check,
return True; else return False
- get_array(self)
- Return the array
- get_clim(self)
- return the min, max of the color limits for image scaling
- get_cmap(self)
- return the colormap
- set_array(self, A)
- Set the image array from numpy array *A*
- set_clim(self, vmin=None, vmax=None)
- 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
- set_cmap(self, cmap)
- set the colormap for luminance data
ACCEPTS: a colormap
- set_colorbar(self, im, ax)
- set the colorbar image and axes associated with mappable
- set_norm(self, norm)
- set the normalization instance
- to_rgba(self, x, alpha=1.0, bytes=False)
- 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.
|
class Quiver(matplotlib.collections.PolyCollection) |
|
Specialized PolyCollection for arrows.
The only API method is set_UVC(), which can be used
to change the size, orientation, and color of the
arrows; their locations are fixed when the class is
instantiated. Possibly this method will be useful
in animations.
Much of the work in this class is done in the draw()
method so that as much information as possible is available
about the plot. In subsequent draw() calls, recalculation
is limited to things that might have changed, so there
should be no performance penalty from putting the calculations
in the draw() method. |
|
- Method resolution order:
- Quiver
- matplotlib.collections.PolyCollection
- matplotlib.collections.Collection
- matplotlib.artist.Artist
- __builtin__.object
- matplotlib.cm.ScalarMappable
Methods defined here:
- __init__(self, ax, *args, **kw)
- The constructor takes one required argument, an Axes
instance, followed by the args and kwargs described
by the following pylab interface documentation:
Plot a 2-D field of arrows.
call signatures::
quiver(U, V, **kw)
quiver(U, V, C, **kw)
quiver(X, Y, U, V, **kw)
quiver(X, Y, U, V, C, **kw)
Arguments:
*X*, *Y*:
The x and y coordinates of the arrow locations
(default is tail of arrow; see *pivot* kwarg)
*U*, *V*:
give the *x* and *y* components of the arrow vectors
*C*:
an optional array used to map colors to the arrows
All arguments may be 1-D or 2-D arrays or sequences. If *X* and *Y*
are absent, they will be generated as a uniform grid. If *U* and *V*
are 2-D arrays but *X* and *Y* are 1-D, and if len(*X*) and len(*Y*)
match the column and row dimensions of *U*, then *X* and *Y* will be
expanded with :func:`numpy.meshgrid`.
*U*, *V*, *C* may be masked arrays, but masked *X*, ** are not
supported at present.
Keyword arguments:
*units*: ['width' | 'height' | 'dots' | 'inches' | 'x' | 'y' ]
arrow units; the arrow dimensions *except for length* are
in multiples of this unit.
* 'width' or 'height': the width or height of the axes
* 'dots' or 'inches': pixels or inches, based on the figure dpi
* 'x' or 'y': *X* or *Y* data units
In all cases the arrow aspect ratio is 1, so that if *U*==*V* the
angle of the arrow on the plot is 45 degrees CCW from the *x*-axis.
The arrows scale differently depending on the units, however.
For 'x' or 'y', the arrows get larger as one zooms in; for other
units, the arrow size is independent of the zoom state. For
'width or 'height', the arrow size increases with the width and
height of the axes, respectively, when the the window is resized;
for 'dots' or 'inches', resizing does not change the arrows.
*scale*: [ None | float ]
data units per arrow unit, e.g. m/s per plot width;
a smaller scale parameter makes the arrow longer.
If *None*, a simple autoscaling algorithm is used, based
on the average vector length and the number of vectors.
*width*:
shaft width in arrow units; default depends on choice of units,
above, and number of vectors; a typical starting value is about
0.005 times the width of the plot.
*headwidth*: scalar
head width as multiple of shaft width, default is 3
*headlength*: scalar
head length as multiple of shaft width, default is 5
*headaxislength*: scalar
head length at shaft intersection, default is 4.5
*minshaft*: scalar
length below which arrow scales, in units of head length. Do not
set this to less than 1, or small arrows will look terrible!
Default is 1
*minlength*: scalar
minimum length as a multiple of shaft width; if an arrow length
is less than this, plot a dot (hexagon) of this diameter instead.
Default is 1.
*pivot*: [ 'tail' | 'middle' | 'tip' ]
The part of the arrow that is at the grid point; the arrow
rotates about this point, hence the name *pivot*.
*color*: [ color | color sequence ]
This is a synonym for the
:class:`~matplotlib.collections.PolyCollection` facecolor kwarg.
If *C* has been set, *color* has no effect.
The defaults give a slightly swept-back arrow; to make the head a
triangle, make *headaxislength* the same as *headlength*. To make the
arrow more pointed, reduce *headwidth* or increase *headlength* and
*headaxislength*. To make the head smaller relative to the shaft,
scale down all the head parameters. You will probably do best to leave
minshaft alone.
linewidths and edgecolors can be used to customize the arrow
outlines. Additional :class:`~matplotlib.collections.PolyCollection`
keyword arguments:
============ ======================================================================
Property Description
============ ======================================================================
alpha float
animated [True | False]
antialiased Boolean or sequence of booleans
antialiaseds Boolean or sequence of booleans
array unknown
axes an axes instance
clim a length 2 sequence of floats
clip_box a :class:`matplotlib.transform.Bbox` instance
clip_on [True | False]
clip_path a :class:`~matplotlib.path.Path` instance and a
cmap a colormap
color matplotlib color arg or sequence of rgba tuples
colorbar unknown
contains unknown
dashes ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
edgecolor matplotlib color arg or sequence of rgba tuples
edgecolors matplotlib color arg or sequence of rgba tuples
facecolor matplotlib color arg or sequence of rgba tuples
facecolors matplotlib color arg or sequence of rgba tuples
figure a :class:`matplotlib.figure.Figure` instance
label any string
linestyle ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
linestyles ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
linewidth float or sequence of floats
linewidths float or sequence of floats
lod [True | False]
lw float or sequence of floats
norm unknown
offsets float or sequence of floats
picker [None|float|boolean|callable]
pickradius unknown
transform unknown
visible [True | False]
zorder any number
============ ======================================================================
- draw(self, renderer)
- set_UVC(self, U, V, C=None)
Data and other attributes defined here:
- quiver_doc = '\nPlot a 2-D field of arrows.\n\ncall signatures::\n...===============================================\n\n'
Methods inherited from matplotlib.collections.PolyCollection:
- get_paths(self)
- set_verts(self, verts, closed=True)
- This allows one to delay initialization of the vertices.
Methods inherited from matplotlib.collections.Collection:
- contains(self, mouseevent)
- Test whether the mouse event occurred in the collection.
Returns True | False, ``dict(ind=itemlist)``, where every
item in itemlist contains the event.
- get_dashes = get_linestyles(self)
- get_datalim(self, transData)
- get_edgecolor(self)
- get_edgecolors = get_edgecolor(self)
- get_facecolor(self)
- get_facecolors = get_facecolor(self)
- get_linestyle = get_linestyles(self)
- get_linestyles(self)
- get_linewidth = get_linewidths(self)
- get_linewidths(self)
- get_offsets(self)
- Return the offsets for the collection.
- get_pickradius(self)
- get_transforms(self)
- set_alpha(self, alpha)
- Set the alpha tranparencies of the collection. *alpha* must be
a float.
ACCEPTS: float
- set_antialiased(self, aa)
- Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
- set_antialiaseds = set_antialiased(self, aa)
- Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
- set_color(self, c)
- Set both the edgecolor and the facecolor.
See :meth:`set_facecolor` and :meth:`set_edgecolor`.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
- set_dashes = set_linestyles(self, ls)
- Set the linestyles(s) for the collection.
ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
- set_edgecolor(self, c)
- 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
- set_edgecolors = set_edgecolor(self, c)
- 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
- set_facecolor(self, c)
- 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
- set_facecolors = set_facecolor(self, c)
- 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
- set_linestyle = set_linestyles(self, ls)
- Set the linestyles(s) for the collection.
ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
- set_linestyles(self, ls)
- Set the linestyles(s) for the collection.
ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ]
- set_linewidth = set_linewidths(self, lw)
- Set the linewidth(s) for the collection. *lw* can be a scalar
or a sequence; if it is a sequence the patches will cycle
through the sequence
ACCEPTS: float or sequence of floats
- set_linewidths(self, lw)
- Set the linewidth(s) for the collection. *lw* can be a scalar
or a sequence; if it is a sequence the patches will cycle
through the sequence
ACCEPTS: float or sequence of floats
- set_lw = set_linewidths(self, lw)
- Set the linewidth(s) for the collection. *lw* can be a scalar
or a sequence; if it is a sequence the patches will cycle
through the sequence
ACCEPTS: float or sequence of floats
- set_offsets(self, offsets)
- Set the offsets for the collection. *offsets* can be a scalar
or a sequence.
ACCEPTS: float or sequence of floats
- set_pickradius(self, pickradius)
- update_scalarmappable(self)
- If the scalar mappable array is not none, update colors
from scalar data
Data and other attributes inherited from matplotlib.collections.Collection:
- zorder = 1
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- convert_xunits(self, x)
- for artists in an axes, if the xaxis as units support,
convert *x* using xaxis unit type
- convert_yunits(self, y)
- for artists in an axes, if the yaxis as units support,
convert *y* using yaxis unit type
- findobj(self, match=None)
- pyplot signature:
findobj(o=gcf(), match=None)
recursively find all :class:matplotlib.artist.Artist instances
contained in self
*match* can be
- None: return all objects contained in artist (including artist)
- function with signature ``boolean = match(artist)`` used to filter matches
- class instance: eg Line2D. Only return artists of class type
.. plot:: ../mpl_examples/pylab_examples/findobj_demo.py
- get_alpha(self)
- Return the alpha value used for blending - not supported on all
backends
- get_animated(self)
- return the artist's animated state
- get_axes(self)
- return the axes instance the artist resides in, or *None*
- get_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- get_clip_path(self)
- Return artist clip path
- get_contains(self)
- return the _contains test used by the artist, or *None* for default.
- get_figure(self)
- Return the :class:`~matplotlib.figure.Figure` instance the
artist belongs to.
- get_label(self)
- get_picker(self)
- return the Pickeration instance used by this artist
- get_transform(self)
- Return the :class:`~matplotlib.transforms.Transform`
instance used by this artist.
- get_transformed_clip_path_and_affine(self)
- Return the clip path with the non-affine part of its
transformation applied, and the remaining affine part of its
transformation.
- get_visible(self)
- return the artist's visiblity
- get_zorder(self)
- have_units(self)
- return *True* if units are set on the x or y axes
- hitlist(self, event)
- List the children of the artist which contain the mouse event
- is_figure_set(self)
- is_transform_set(self)
- Artist has transform explicity let
- pchanged(self)
- fire event when property changed
- pick(self, mouseevent)
- call signature::
pick(mouseevent)
each child artist will fire a pick event if *mouseevent* is over
the artist and the artist has picker set
- pickable(self)
- return *True* if self is pickable
- remove(self)
- Remove the artist from the figure if possible. The effect
will not be visible until the figure is redrawn, e.g., with
:meth:`matplotlib.axes.Axes.draw_idle`. Call
:meth:`matplotlib.axes.Axes.relim` to update the axes limits
if desired.
Note: :meth:`~matplotlib.axes.Axes.relim` will not see
collections even if the collection was added to axes with
*autolim* = True.
Note: there is no support for removing the artist's legend entry.
- remove_callback(self, oid)
- set(self, **kwargs)
- A tkstyle set command, pass *kwargs* to set properties
- set_animated(self, b)
- set the artist's animation state
ACCEPTS: [True | False]
- set_axes(self, axes)
- set the axes instance in which the artist resides, if any
ACCEPTS: an axes instance
- set_clip_box(self, clipbox)
- Set the artist's clip Bbox
ACCEPTS: a :class:`matplotlib.transform.Bbox` instance
- set_clip_on(self, b)
- Set whether artist uses clipping
ACCEPTS: [True | False]
- set_clip_path(self, path, transform=None)
- Set the artist's clip path, which may be:
* a :class:`~matplotlib.patches.Patch` (or subclass) instance
* a :class:`~matplotlib.path.Path` instance, in which case
an optional :class:`~matplotlib.transforms.Transform`
instance may be provided, which will be applied to the
path before using it for clipping.
* *None*, to remove the clipping path
For efficiency, if the path happens to be an axis-aligned
rectangle, this method will set the clipping box to the
corresponding rectangle and set the clipping path to *None*.
ACCEPTS: a :class:`~matplotlib.path.Path` instance and a
:class:`~matplotlib.transforms.Transform` instance, a
:class:`~matplotlib.patches.Patch` instance, or *None*.
- set_contains(self, picker)
- Replace the contains test used by this artist. The new picker should
be a callable function which determines whether the artist is hit by the
mouse event::
hit, props = picker(artist, mouseevent)
If the mouse event is over the artist, return *hit=True* and *props*
is a dictionary of properties you want returned with the contains test.
- set_figure(self, fig)
- Set the :class:`~matplotlib.figure.Figure` instance the artist
belongs to.
ACCEPTS: a :class:`matplotlib.figure.Figure` instance
- set_label(self, s)
- Set the line label to *s* for auto legend
ACCEPTS: any string
- set_lod(self, on)
- Set Level of Detail on or off. If on, the artists may examine
things like the pixel width of the axes and draw a subset of
their contents accordingly
ACCEPTS: [True | False]
- set_picker(self, picker)
- set the epsilon for picking used by this artist
*picker* can be one of the following:
* *None*: picking is disabled for this artist (default)
* A boolean: if *True* then picking will be enabled and the
artist will fire a pick event if the mouse event is over
the artist
* A float: if picker is a number it is interpreted as an
epsilon tolerance in points and the artist will fire
off an event if it's data is within epsilon of the mouse
event. For some artists like lines and patch collections,
the artist may provide additional data to the pick event
that is generated, e.g. the indices of the data within
epsilon of the pick event
* A function: if picker is callable, it is a user supplied
function which determines whether the artist is hit by the
mouse event::
hit, props = picker(artist, mouseevent)
to determine the hit test. if the mouse event is over the
artist, return *hit=True* and props is a dictionary of
properties you want added to the PickEvent attributes.
ACCEPTS: [None|float|boolean|callable]
- set_transform(self, t)
- Set the :class:`~matplotlib.transforms.Transform` instance
used by this artist.
- set_visible(self, b)
- set the artist's visiblity
ACCEPTS: [True | False]
- set_zorder(self, level)
- Set the zorder for the artist
ACCEPTS: any number
- update(self, props)
- update_from(self, other)
- Copy properties from *other* to *self*.
Data descriptors inherited from matplotlib.artist.Artist:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from matplotlib.artist.Artist:
- aname = 'Artist'
Methods inherited from matplotlib.cm.ScalarMappable:
- add_checker(self, checker)
- Add an entry to a dictionary of boolean flags
that are set to True when the mappable is changed.
- autoscale(self)
- Autoscale the scalar limits on the norm instance using the
current array
- autoscale_None(self)
- Autoscale the scalar limits on the norm instance using the
current array, changing only limits that are None
- changed(self)
- Call this whenever the mappable is changed to notify all the
callbackSM listeners to the 'changed' signal
- check_update(self, checker)
- If mappable has changed since the last check,
return True; else return False
- get_array(self)
- Return the array
- get_clim(self)
- return the min, max of the color limits for image scaling
- get_cmap(self)
- return the colormap
- set_array(self, A)
- Set the image array from numpy array *A*
- set_clim(self, vmin=None, vmax=None)
- 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
- set_cmap(self, cmap)
- set the colormap for luminance data
ACCEPTS: a colormap
- set_colorbar(self, im, ax)
- set the colorbar image and axes associated with mappable
- set_norm(self, norm)
- set the normalization instance
- to_rgba(self, x, alpha=1.0, bytes=False)
- 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.
|
class QuiverKey(matplotlib.artist.Artist) |
|
Labelled arrow for use as a quiver plot scale key. |
|
- Method resolution order:
- QuiverKey
- matplotlib.artist.Artist
- __builtin__.object
Methods defined here:
- __init__(self, Q, X, Y, U, label, **kw)
- Add a key to a quiver plot.
call signature::
quiverkey(Q, X, Y, U, label, **kw)
Arguments:
*Q*:
The Quiver instance returned by a call to quiver.
*X*, *Y*:
The location of the key; additional explanation follows.
*U*:
The length of the key
*label*:
a string with the length and units of the key
Keyword arguments:
*coordinates* = [ 'axes' | 'figure' | 'data' | 'inches' ]
Coordinate system and units for *X*, *Y*: 'axes' and 'figure'
are normalized coordinate systems with 0,0 in the lower
left and 1,1 in the upper right; 'data' are the axes
data coordinates (used for the locations of the vectors
in the quiver plot itself); 'inches' is position in the
figure in inches, with 0,0 at the lower left corner.
*color*:
overrides face and edge colors from *Q*.
*labelpos* = [ 'N' | 'S' | 'E' | 'W' ]
Position the label above, below, to the right, to the left
of the arrow, respectively.
*labelsep*:
Distance in inches between the arrow and the label.
Default is 0.1
*labelcolor*:
defaults to default :class:`~matplotlib.text.Text` color.
*fontproperties*:
A dictionary with keyword arguments accepted by the
:class:`~matplotlib.font_manager.FontProperties` initializer:
*family*, *style*, *variant*, *size*, *weight*
Any additional keyword arguments are used to override vector
properties taken from *Q*.
The positioning of the key depends on *X*, *Y*, *coordinates*, and
*labelpos*. If *labelpos* is 'N' or 'S', *X*, *Y* give the position
of the middle of the key arrow. If *labelpos* is 'E', *X*, *Y*
positions the head, and if *labelpos* is 'W', *X*, *Y* positions the
tail; in either of these two cases, *X*, *Y* is somewhere in the
middle of the arrow+label key object.
- contains(self, mouseevent)
- draw(self, renderer)
- set_figure(self, fig)
Data and other attributes defined here:
- halign = {'E': 'left', 'N': 'center', 'S': 'center', 'W': 'right'}
- pivot = {'E': 'tip', 'N': 'mid', 'S': 'mid', 'W': 'tail'}
- quiverkey_doc = '\nAdd a key to a quiver plot.\n\ncall signature::\n\n...ere in the\nmiddle of the arrow+label key object.\n'
- valign = {'E': 'center', 'N': 'bottom', 'S': 'top', 'W': 'center'}
Methods inherited from matplotlib.artist.Artist:
- add_callback(self, func)
- convert_xunits(self, x)
- for artists in an axes, if the xaxis as units support,
convert *x* using xaxis unit type
- convert_yunits(self, y)
- for artists in an axes, if the yaxis as units support,
convert *y* using yaxis unit type
- findobj(self, match=None)
- pyplot signature:
findobj(o=gcf(), match=None)
recursively find all :class:matplotlib.artist.Artist instances
contained in self
*match* can be
- None: return all objects contained in artist (including artist)
- function with signature ``boolean = match(artist)`` used to filter matches
- class instance: eg Line2D. Only return artists of class type
.. plot:: ../mpl_examples/pylab_examples/findobj_demo.py
- get_alpha(self)
- Return the alpha value used for blending - not supported on all
backends
- get_animated(self)
- return the artist's animated state
- get_axes(self)
- return the axes instance the artist resides in, or *None*
- get_clip_box(self)
- Return artist clipbox
- get_clip_on(self)
- Return whether artist uses clipping
- get_clip_path(self)
- Return artist clip path
- get_contains(self)
- return the _contains test used by the artist, or *None* for default.
- get_figure(self)
- Return the :class:`~matplotlib.figure.Figure` instance the
artist belongs to.
- get_label(self)
- get_picker(self)
- return the Pickeration instance used by this artist
- get_transform(self)
- Return the :class:`~matplotlib.transforms.Transform`
instance used by this artist.
- get_transformed_clip_path_and_affine(self)
- Return the clip path with the non-affine part of its
transformation applied, and the remaining affine part of its
transformation.
- get_visible(self)
- return the artist's visiblity
- get_zorder(self)
- have_units(self)
- return *True* if units are set on the x or y axes
- hitlist(self, event)
- List the children of the artist which contain the mouse event
- is_figure_set(self)
- is_transform_set(self)
- Artist has transform explicity let
- pchanged(self)
- fire event when property changed
- pick(self, mouseevent)
- call signature::
pick(mouseevent)
each child artist will fire a pick event if *mouseevent* is over
the artist and the artist has picker set
- pickable(self)
- return *True* if self is pickable
- remove(self)
- Remove the artist from the figure if possible. The effect
will not be visible until the figure is redrawn, e.g., with
:meth:`matplotlib.axes.Axes.draw_idle`. Call
:meth:`matplotlib.axes.Axes.relim` to update the axes limits
if desired.
Note: :meth:`~matplotlib.axes.Axes.relim` will not see
collections even if the collection was added to axes with
*autolim* = True.
Note: there is no support for removing the artist's legend entry.
- remove_callback(self, oid)
- set(self, **kwargs)
- A tkstyle set command, pass *kwargs* to set properties
- set_alpha(self, alpha)
- Set the alpha value used for blending - not supported on
all backends
ACCEPTS: float
- set_animated(self, b)
- set the artist's animation state
ACCEPTS: [True | False]
- set_axes(self, axes)
- set the axes instance in which the artist resides, if any
ACCEPTS: an axes instance
- set_clip_box(self, clipbox)
- Set the artist's clip Bbox
ACCEPTS: a :class:`matplotlib.transform.Bbox` instance
- set_clip_on(self, b)
- Set whether artist uses clipping
ACCEPTS: [True | False]
- set_clip_path(self, path, transform=None)
- Set the artist's clip path, which may be:
* a :class:`~matplotlib.patches.Patch` (or subclass) instance
* a :class:`~matplotlib.path.Path` instance, in which case
an optional :class:`~matplotlib.transforms.Transform`
instance may be provided, which will be applied to the
path before using it for clipping.
* *None*, to remove the clipping path
For efficiency, if the path happens to be an axis-aligned
rectangle, this method will set the clipping box to the
corresponding rectangle and set the clipping path to *None*.
ACCEPTS: a :class:`~matplotlib.path.Path` instance and a
:class:`~matplotlib.transforms.Transform` instance, a
:class:`~matplotlib.patches.Patch` instance, or *None*.
- set_contains(self, picker)
- Replace the contains test used by this artist. The new picker should
be a callable function which determines whether the artist is hit by the
mouse event::
hit, props = picker(artist, mouseevent)
If the mouse event is over the artist, return *hit=True* and *props*
is a dictionary of properties you want returned with the contains test.
- set_label(self, s)
- Set the line label to *s* for auto legend
ACCEPTS: any string
- set_lod(self, on)
- Set Level of Detail on or off. If on, the artists may examine
things like the pixel width of the axes and draw a subset of
their contents accordingly
ACCEPTS: [True | False]
- set_picker(self, picker)
- set the epsilon for picking used by this artist
*picker* can be one of the following:
* *None*: picking is disabled for this artist (default)
* A boolean: if *True* then picking will be enabled and the
artist will fire a pick event if the mouse event is over
the artist
* A float: if picker is a number it is interpreted as an
epsilon tolerance in points and the artist will fire
off an event if it's data is within epsilon of the mouse
event. For some artists like lines and patch collections,
the artist may provide additional data to the pick event
that is generated, e.g. the indices of the data within
epsilon of the pick event
* A function: if picker is callable, it is a user supplied
function which determines whether the artist is hit by the
mouse event::
hit, props = picker(artist, mouseevent)
to determine the hit test. if the mouse event is over the
artist, return *hit=True* and props is a dictionary of
properties you want added to the PickEvent attributes.
ACCEPTS: [None|float|boolean|callable]
- set_transform(self, t)
- Set the :class:`~matplotlib.transforms.Transform` instance
used by this artist.
- set_visible(self, b)
- set the artist's visiblity
ACCEPTS: [True | False]
- set_zorder(self, level)
- Set the zorder for the artist
ACCEPTS: any number
- update(self, props)
- update_from(self, other)
- Copy properties from *other* to *self*.
Data descriptors inherited from matplotlib.artist.Artist:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from matplotlib.artist.Artist:
- aname = 'Artist'
- zorder = 0
| |