matplotlib.spines¶matplotlib.spines.Spine(axes, spine_type, path, **kwargs)[source]¶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 function:set_position
for more information.
The default position is ('outward',0).
Spines are subclasses of class:Patch, and
inherit much of their behavior.
Spines draw a line, a circle, or an arc depending if
function:set_patch_line,
function:set_patch_circle, or
function:set_patch_arc has been called.
Line-like is the default.
Valid kwargs are:
Property Description agg_filtera filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array alphafloat or None animatedbool antialiasedor aaunknown capstyle{'butt', 'round', 'projecting'} clip_boxBboxclip_onbool clip_path[( Path,Transform) |Patch| None]colorcolor containscallable edgecoloror eccolor or None or 'auto' facecoloror fccolor or None figureFigurefillbool gidstr hatch{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} in_layoutbool joinstyle{'miter', 'round', 'bevel'} labelobject linestyleor ls{'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidthor lwfloat or None path_effectsAbstractPathEffectpickerNone or bool or float or callable rasterizedbool or None sketch_params(scale: float, length: float, randomness: float) snapbool or None transformTransformurlstr visiblebool zorderfloat
arc_spine(axes, spine_type, center, radius, theta1, theta2, **kwargs)[source]¶(classmethod) Returns an arc Spine.
circular_spine(axes, center, radius, **kwargs)[source]¶(staticmethod) Returns a circular Spine.
get_patch_transform()[source]¶Return the Transform instance which
takes 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.
get_window_extent(renderer=None)[source]¶Return the window extent of the spines in display space, including padding for ticks (but not their labels)
is_frame_like()[source]¶[Deprecated] Return True if directly on axes frame.
This is useful for determining if a spine is the edge of an old style MPL plot. If so, this function will return True.
Notes
Deprecated since version 3.1.
linear_spine(axes, spine_type, **kwargs)[source]¶(staticmethod) Returns a linear Spine.
register_axis(axis)[source]¶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_color(c)[source]¶Set the edgecolor.
| Parameters: | c : color |
|---|
Notes
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_position(position)[source]¶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: