Bases: matplotlib.patches.Patch
An axis spine -- the line noting the data area boundaries.
Spines are the lines connecting the axis tick marks and noting the boundaries of the data area. They can be placed at arbitrary positions. See set_position
for more information.
The default position is ('outward', 0)
.
Spines are subclasses of Patch
, and inherit much of their behavior.
Spines draw a line, a circle, or an arc depending if set_patch_line
, set_patch_circle
, or set_patch_arc
has been called. Line-like is the default.
Valid keyword arguments are:
Property | Description |
---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array | |
unknown | |
bool | |
| bool or None |
| |
bool | |
Patch or (Path, Transform) or None | |
color | |
| color or None |
| color or None |
bool | |
str | |
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} | |
bool | |
| |
object | |
| {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| float or None |
None or bool or float or callable | |
bool | |
(scale: float, length: float, randomness: float) | |
bool or None | |
str | |
bool | |
float |
Create and return an arc Spine
.
Create and return a circular Spine
.
[Deprecated]
Deprecated since version 3.4:
Clear the current spine.
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible
returns False).
RendererBase
subclass.
This method is overridden in the Artist subclasses.
Get the bounds of the spine.
Return the Transform
instance mapping patch coordinates to data coordinates.
For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
Return the path of this patch.
Return the spine position.
Return the spine transform.
Return the window extent of the spines in display space, including padding for ticks (but not their labels)
Register an axis.
An axis should be registered with its corresponding spine from the Axes instance. This allows the spine to clear any axis properties when needed.
Set multiple properties at once.
Supported properties are
Property | Description |
---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array | |
scalar or None | |
bool | |
| bool or None |
(low: float, high: float) | |
| |
bool | |
Patch or (Path, Transform) or None | |
color | |
| color or None |
| color or None |
bool | |
str | |
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} | |
bool | |
| |
object | |
| {'-', '--', '-.', ':', '', (offset, on-off-seq), ...} |
| float or None |
unknown | |
unknown | |
None or bool or float or callable | |
unknown | |
bool | |
(scale: float, length: float, randomness: float) | |
bool or None | |
str | |
bool | |
float |
Set the spine bounds.
The lower spine bound. Passing None leaves the limit unchanged.
The bounds may also be passed as the tuple (low, high) as the first positional argument.
The higher spine bound. Passing None leaves the limit unchanged.
Set the edgecolor.
This method does not modify the facecolor (which defaults to "none"), unlike the Patch.set_color
method defined in the parent class. Use Patch.set_facecolor
to set the facecolor.
Set the spine to be arc-like.
Set the spine to be circular.
Set the spine to be linear.
Set the position of the spine.
Spine position is specified by a 2 tuple of (position type, amount). The position types are:
Additionally, shorthand notations define a special positions:
Bases: collections.abc.MutableMapping
The container of all Spine
s in an Axes.
The interface is dict-like mapping names (e.g. 'left') to Spine
objects. Additionally it implements some pandas.Series-like features like accessing elements by attribute:
spines['top'].set_visible(False) spines.top.set_visible(False)
Multiple spines can be addressed simultaneously by passing a list:
spines[['top', 'right']].set_visible(False)
Use an open slice to address all spines:
spines[:].set_visible(False)
The latter two indexing methods will return a SpinesProxy
that broadcasts all set_*
calls to its members, but cannot be used for any other operation.
Bases: object
A proxy to broadcast set_*
method calls to all contained Spines
.
The proxy cannot be used for any other operations on its members.
The supported methods are determined dynamically based on the contained spines. If not all spines support a given method, it's executed only on the subset of spines that support it.
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/spines_api.html