Classes for the efficient drawing of large collections of objects that share most properties, e.g., a large number of line segments or polygons.
The classes are not meant to be as flexible as their single element counterparts (e.g., you may not be able to select all line styles) but they are meant to be fast for common use cases (e.g., a large set of solid line segemnts)
Bases: matplotlib.collections.RegularPolyCollection
Draw a collection of regular asterisks with numsides points.
gives the area of the circle circumscribing the regular polygon in points^2
Valid Collection keyword arguments:
- edgecolors: None
- facecolors: None
- linewidths: None
- antialiaseds: None
- offsets: None
- transOffset: transforms.IdentityTransform()
- norm: None (optional for matplotlib.cm.ScalarMappable)
- cmap: None (optional for matplotlib.cm.ScalarMappable)
offsets and transOffset are used to translate the patch after rendering (default no offsets)
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
Example: see 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,
)
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element.
Returns: | sizes : array
|
---|
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Set the sizes of each member of the collection.
Parameters: | sizes : ndarray or None
dpi : float
|
---|
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections.PolyCollection
A collection of horizontal bars spanning yrange with a sequence of xranges.
ymin, ywidth
Valid Collection keyword arguments:
- edgecolors: None
- facecolors: None
- linewidths: None
- antialiaseds: None
- offsets: None
- transOffset: transforms.IdentityTransform()
- norm: None (optional for matplotlib.cm.ScalarMappable)
- cmap: None (optional for matplotlib.cm.ScalarMappable)
offsets and transOffset are used to translate the patch after rendering (default no offsets)
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element.
Returns: | sizes : array
|
---|
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
This allows one to delay initialization of the vertices.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Set the sizes of each member of the collection.
Parameters: | sizes : ndarray or None
dpi : float
|
---|
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
This allows one to delay initialization of the vertices.
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
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 BrokenBarHCollection is returned. kwargs are passed on to the collection.
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections._CollectionWithSizes
A collection of circles, drawn using splines.
sizes Gives the area of the circle in points^2
Valid Collection keyword arguments:
- edgecolors: None
- facecolors: None
- linewidths: None
- antialiaseds: None
- offsets: None
- transOffset: transforms.IdentityTransform()
- norm: None (optional for matplotlib.cm.ScalarMappable)
- cmap: None (optional for matplotlib.cm.ScalarMappable)
offsets and transOffset are used to translate the patch after rendering (default no offsets)
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element.
Returns: | sizes : array
|
---|
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Set the sizes of each member of the collection.
Parameters: | sizes : ndarray or None
dpi : float
|
---|
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.artist.Artist, matplotlib.cm.ScalarMappable
Base class for Collections. Must be subclassed to be usable.
All properties in a collection must be sequences or scalars; if scalars, they will be converted to sequences. The property of the ith element of the collection is:
prop[i % len(props)]
Keyword arguments and default values:
- edgecolors: None
- facecolors: None
- linewidths: None
- antialiaseds: None
- offsets: None
- transOffset: transforms.IdentityTransform()
- offset_position: ‘screen’ (default) or ‘data’
- norm: None (optional for matplotlib.cm.ScalarMappable)
- cmap: None (optional for matplotlib.cm.ScalarMappable)
- hatch: None
- zorder: 1
offsets and transOffset are used to translate the patch after rendering (default no offsets). If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
The use of ScalarMappable is optional. If the ScalarMappable matrix _A is not None (i.e., a call to set_array has been made), at draw time a call to scalar mappable will be made to set the face colors.
Create a Collection
%(Collection)s
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections.Collection
A collection of ellipses, drawn using splines.
units: [‘points’ | ‘inches’ | ‘dots’ | ‘width’ | ‘height’ | ‘x’ | ‘y’ | ‘xy’]
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. ‘xy’ differs from all others in that the angle as plotted varies with the aspect ratio, and equals the specified angle only when the aspect ratio is unity. Hence it behaves the same as the Ellipse with axes.transData as its transform.
Additional kwargs inherited from the base Collection:
Valid Collection keyword arguments:
- edgecolors: None
- facecolors: None
- linewidths: None
- antialiaseds: None
- offsets: None
- transOffset: transforms.IdentityTransform()
- norm: None (optional for matplotlib.cm.ScalarMappable)
- cmap: None (optional for matplotlib.cm.ScalarMappable)
offsets and transOffset are used to translate the patch after rendering (default no offsets)
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections.LineCollection
A collection of discrete events.
An event is a 1-dimensional value, usually the position of something along an axis, such as time or length. Events do not have an amplitude. They are displayed as v
linestyle [ ‘solid’ | ‘dashed’ | ‘dashdot’ | ‘dotted’ ]
If linewidth, color, or antialiased is None, they default to their rcParams setting, in sequence form.
pickradius is the tolerance for mouse clicks picking a line. The default is 5 pt.
The use of ScalarMappable is optional. If the ScalarMappable array _A is not None (i.e., a call to set_array() has been made), at draw time a call to scalar mappable will be made to set the colors.
Example:
(Source code, png)
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
add one or more events at the specified positions
add one or more events at the specified positions
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
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
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
add one or more events at the specified positions
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
get the color of the lines used to mark each event
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
get the length of the lines used to mark each event
get the offset of the lines used to mark each event
get the style of the lines used to mark each event [ ‘solid’ | ‘dashed’ | ‘dashdot’ | ‘dotted’ ]
get the width of the lines used to mark each event
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
get the orientation of the event line, may be: [ ‘horizontal’ | ‘vertical’ ]
Return the picker object used by this artist
return an array containing the floating-point values of the positions
return True if the artist is to be rasterized
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
True if the eventcollection is horizontal, False if vertical
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
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
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
set the length of the lines used to mark each event
set the offset of the lines used to mark each event
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set the orientation of the event line [ ‘horizontal’ | ‘vertical’ | None ] defaults to ‘horizontal’ if not specified or None
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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 the positions of the events to the specified value
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
switch the orientation of the event line, either from vertical to horizontal or vice versus
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections.Collection
All parameters must be sequences or scalars; if scalars, they will be converted to sequences. The property of the ith line segment is:
prop[i % len(props)]
i.e., the properties cycle if the len of props is less than the number of 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.
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.
pickradius is the tolerance for mouse clicks picking a line. The default is 5 pt.
The use of ScalarMappable is optional. If the ScalarMappable array _A is not None (i.e., a call to set_array() has been made), at draw time a call to scalar mappable will be made to set the colors.
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
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
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
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
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections.Collection
A generic collection of patches.
This makes it easier to assign a color map to a heterogeneous collection of patches.
This also may improve plotting speed, since PatchCollection will draw faster than a large number of patches.
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
The use of ScalarMappable is optional. If the ScalarMappable matrix _A is not None (i.e., a call to set_array has been made), at draw time a call to scalar mappable will be made to set the face colors.
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections._CollectionWithSizes
This is the most basic Collection subclass.
paths is a sequence of matplotlib.path.Path instances.
Valid Collection keyword arguments:
- edgecolors: None
- facecolors: None
- linewidths: None
- antialiaseds: None
- offsets: None
- transOffset: transforms.IdentityTransform()
- norm: None (optional for matplotlib.cm.ScalarMappable)
- cmap: None (optional for matplotlib.cm.ScalarMappable)
offsets and transOffset are used to translate the patch after rendering (default no offsets)
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element.
Returns: | sizes : array
|
---|
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Set the sizes of each member of the collection.
Parameters: | sizes : ndarray or None
dpi : float
|
---|
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections._CollectionWithSizes
verts is a sequence of ( verts0, verts1, ...) where verts_i is a sequence of xy tuples of vertices, or an equivalent 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.
Valid Collection keyword arguments:
- edgecolors: None
- facecolors: None
- linewidths: None
- antialiaseds: None
- offsets: None
- transOffset: transforms.IdentityTransform()
- norm: None (optional for matplotlib.cm.ScalarMappable)
- cmap: None (optional for matplotlib.cm.ScalarMappable)
offsets and transOffset are used to translate the patch after rendering (default no offsets)
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element.
Returns: | sizes : array
|
---|
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
This allows one to delay initialization of the vertices.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Set the sizes of each member of the collection.
Parameters: | sizes : ndarray or None
dpi : float
|
---|
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
This allows one to delay initialization of the vertices.
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections.Collection
Class for the efficient drawing of a quadrilateral mesh.
A quadrilateral mesh consists of a grid of vertices. The dimensions of this array are (meshWidth + 1, meshHeight + 1). Each vertex in the mesh has a different set of “mesh coordinates” representing its position in the topology of the mesh. For any values (m, n) such that 0 <= m <= meshWidth and 0 <= n <= meshHeight, the vertices at mesh coordinates (m, n), (m, n + 1), (m + 1, n + 1), and (m + 1, n) form one of the quadrilaterals in the mesh. There are thus (meshWidth * meshHeight) quadrilaterals in the mesh. The mesh need not be regular and the polygons need not be convex.
A quadrilateral mesh is represented by a (2 x ((meshWidth + 1) * (meshHeight + 1))) numpy array coordinates, where each row is the x and y coordinates of one of the vertices. To define the function that maps from a data point to its corresponding color, use the set_cmap() method. Each of these arrays is indexed in row-major order by the mesh coordinates of the vertex (or the mesh coordinates of the lower left vertex, in the case of the colors).
For example, the first entry in coordinates is the coordinates of the vertex at mesh coordinates (0, 0), then the one at (0, 1), then at (0, 2) .. (0, meshWidth), (1, 0), (1, 1), and so on.
shading may be ‘flat’, or ‘gouraud’
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
Converts a given mesh into a sequence of matplotlib.path.Path objects for easier rendering by backends that do not directly support quadmeshes.
This function is primarily of use to backend implementers.
Converts a given mesh into a sequence of triangles, each point with its own color. This is useful for experiments using draw_qouraud_triangle.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections._CollectionWithSizes
Draw a collection of regular polygons with numsides.
gives the area of the circle circumscribing the regular polygon in points^2
Valid Collection keyword arguments:
- edgecolors: None
- facecolors: None
- linewidths: None
- antialiaseds: None
- offsets: None
- transOffset: transforms.IdentityTransform()
- norm: None (optional for matplotlib.cm.ScalarMappable)
- cmap: None (optional for matplotlib.cm.ScalarMappable)
offsets and transOffset are used to translate the patch after rendering (default no offsets)
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
Example: see 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,
)
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element.
Returns: | sizes : array
|
---|
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Set the sizes of each member of the collection.
Parameters: | sizes : ndarray or None
dpi : float
|
---|
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections.RegularPolyCollection
Draw a collection of regular stars with numsides points.
gives the area of the circle circumscribing the regular polygon in points^2
Valid Collection keyword arguments:
- edgecolors: None
- facecolors: None
- linewidths: None
- antialiaseds: None
- offsets: None
- transOffset: transforms.IdentityTransform()
- norm: None (optional for matplotlib.cm.ScalarMappable)
- cmap: None (optional for matplotlib.cm.ScalarMappable)
offsets and transOffset are used to translate the patch after rendering (default no offsets)
If any of edgecolors, facecolors, linewidths, antialiaseds are None, they default to their matplotlib.rcParams patch setting, in sequence form.
Example: see 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,
)
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sizes of the elements in the collection. The value represents the ‘area’ of the element.
Returns: | sizes : array
|
---|
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Set the sizes of each member of the collection.
Parameters: | sizes : ndarray or None
dpi : float
|
---|
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data
Bases: matplotlib.collections.Collection
Class for the efficient drawing of a triangular mesh using Gouraud shading.
A triangular mesh is a Triangulation object.
Adds a callback function that will be called whenever one of the Artist‘s properties changes.
Returns an id that is useful for removing the callback with remove_callback() later.
Add an entry to a dictionary of boolean flags that are set to True when the mappable is changed.
Autoscale the scalar limits on the norm instance using the current array
Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
Call this whenever the mappable is changed to notify all the callbackSM listeners to the ‘changed’ signal
If mappable has changed since the last check, return True; else return False
Test whether the mouse event occurred in the collection.
Returns True | False, dict(ind=itemlist), where every item in itemlist contains the event.
Converts a given mesh into a sequence of matplotlib.path.Path objects for easier rendering by backends that do not directly support meshes.
This function is primarily of use to backend implementers.
For artists in an axes, if the xaxis has units support, convert x using xaxis unit type
For artists in an axes, if the yaxis has units support, convert y using yaxis unit type
Find artist objects.
Recursively find all Artist instances contained in self.
match can be
- None: return all objects contained in artist.
- function with signature boolean = match(artist) used to filter matches
- class instance: e.g., Line2D. Only return artists of class type.
If include_self is True (default), include self in the list to be checked for a match.
return filter function to be used for agg filter
Return the alpha value used for blending - not supported on all backends
Return the artist’s animated state
Return the array
Return the Axes instance the artist resides in, or None.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
Return a list of the child Artist`s this :class:`Artist contains.
return the min, max of the color limits for image scaling
Return artist clipbox
Return whether artist uses clipping
Return artist clip path
return the colormap
Return the _contains test used by the artist, or None for default.
return whether fill is set
Returns the group id
Return the current hatching pattern
Get the label used for this artist in the legend.
Returns how offsets are applied for the collection. If offset_position is ‘screen’, the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Return the offsets for the collection.
Return the picker object used by this artist
return True if the artist is to be rasterized
Returns the sketch parameters for the artist.
Returns: | sketch_params : tuple or None A 3-tuple with the following elements:
May return None if no sketch parameters were set. |
---|
Returns the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
Returns the url
Return the artist’s visiblity
Return the Artist‘s zorder.
Return True if units are set on the x or y axes
List the children of the artist which contain the mouse event event.
Returns True if Artist has a transform explicitly set.
Fire an event when property changed, calling all of the registered callbacks.
call signature:
pick(mouseevent)
each child artist will fire a pick event if mouseevent is over the artist and the artist has picker set
Return True if Artist is pickable.
return a dictionary mapping property name -> value for all Artist props
Remove the artist from the figure if possible. The effect will not be visible until the figure is redrawn, e.g., with matplotlib.axes.Axes.draw_idle(). Call matplotlib.axes.Axes.relim() to update the axes limits if desired.
Note: 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 a callback based on its id.
See also
A tkstyle set command, pass kwargs to set properties
set agg_filter fuction.
Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
Set the artist’s animation state.
ACCEPTS: [True | False]
Set the antialiasing state for rendering.
ACCEPTS: Boolean or sequence of booleans
alias for set_antialiased
Set the image array from numpy array A
Set the Axes instance in which the artist resides, if any.
This has been deprecated in mpl 1.5, please use the axes property. Will be removed in 1.7 or 2.0.
ACCEPTS: an Axes instance
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 the artist’s clip Bbox.
ACCEPTS: a matplotlib.transforms.Bbox instance
Set whether artist uses clipping.
When False artists will be visible out side of the axes which can lead to unexpected results.
ACCEPTS: [True | False]
Set the artist’s clip path, which may be:
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.
set the colormap for luminance data
ACCEPTS: a colormap or registered colormap name
Set both the edgecolor and the facecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
Deprecated since version 1.3: The set_colorbar function was deprecated in version 1.3. Use the colorbar attribute instead.
set the colorbar and axes instances associated with mappable
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.
ACCEPTS: a callable function
alias for set_linestyle
Set the edgecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of 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. If it is ‘none’, the patch boundary will not be drawn.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_edgecolor
Set the facecolor(s) of the collection. c can be a matplotlib color arg (all patches have same color), or a sequence of rgba tuples; if it is a sequence the patches will cycle through the sequence.
If c is ‘none’, the patch will not be filled.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
alias for set_facecolor
Set the Figure instance the artist belongs to.
ACCEPTS: a matplotlib.figure.Figure instance
Sets the (group) id for the artist
ACCEPTS: an id string
Set the hatching pattern
hatch can be one of:
/ - diagonal hatching
\ - back diagonal
| - vertical
- - horizontal
+ - crossed
x - crossed diagonal
o - small circle
O - large circle
. - dots
* - stars
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Unlike other properties such as linewidth and colors, hatching can only be specified for the collection as a whole, not separately for each member.
ACCEPTS: [ ‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’ ]
Set the label to s for auto legend.
ACCEPTS: string or anything printable with ‘%s’ conversion.
Set the linestyle(s) for the collection.
ACCEPTS: [‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) ]
alias for set_linestyle
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
alias for set_linewidth
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]
alias for set_linewidth
set the normalization instance
Set how offsets are applied. If offset_position is ‘screen’ (default) the offset is applied after the master transform has been applied, that is, the offsets are in screen coordinates. If offset_position is ‘data’, the offset is applied before the master transform, i.e., the offsets are in data coordinates.
Set the offsets for the collection. offsets can be a scalar or a sequence.
ACCEPTS: float or sequence of floats
set path_effects, which should be a list of instances of matplotlib.patheffect._Base class or its derivatives.
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]
Force rasterized (bitmap) drawing in vector backend output.
Defaults to None, which implies the backend’s default behavior
ACCEPTS: [True | False | None]
Sets the the sketch parameters.
Parameters: | scale : float, optional
length : float, optional
randomness : float, optional
|
---|
Sets the snap setting which may be:
- True: snap vertices to the nearest pixel center
- False: leave vertices as-is
- None: (auto) If the path contains only rectilinear line segments, round to the nearest pixel center
Only supported by the Agg and MacOSX backends.
Sets the url for the artist
ACCEPTS: a url string
Set the artist’s visiblity.
ACCEPTS: [True | False]
Set the zorder for the artist. Artists with lower zorder values are drawn first.
ACCEPTS: any number
Return a normalized rgba array corresponding to x.
In the normal case, x is a 1-D or 2-D sequence of scalars, and the corresponding ndarray of rgba values will be returned, based on the norm and colormap set for this ScalarMappable.
There is one special case, for handling images that are already rgb or rgba, such as might have been read from an image file. If x is an ndarray with 3 dimensions, and the last dimension is either 3 or 4, then it will be treated as an rgb or rgba array, and no mapping will be done. If the last dimension is 3, the alpha kwarg (defaulting to 1) will be used to fill in the transparency. If the last dimension is 4, the alpha kwarg is ignored; it does not replace the pre-existing alpha. A ValueError will be raised if the third dimension is other than 3 or 4.
In either case, if bytes is False (default), the rgba array will be floats in the 0-1 range; if it is True, the returned rgba array will be uint8 in the 0 to 255 range.
Note: this method assumes the input is well-behaved; it does not check for anomalies such as x being a masked rgba array, or being an integer type other than uint8, or being a floating point rgba array with values outside the 0-1 range.
Update the properties of this Artist from the dictionary prop.
copy properties from other to self
If the scalar mappable array is not none, update colors from scalar data