
matplotlib.spines¶matplotlib.spines.Spine(axes,spine_type,path,**kwargs)¶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 theboundaries of the data area. They can be placed at arbitrarypositions. See function:set_positionfor more information.
The default position is('outward',0).
Spines are subclasses of class:Patch, andinherit much of their behavior.
Spines draw a line or a circle, depending iffunction:set_patch_line orfunction:set_patch_circle has beencalled. Line-like is the default.
Valid kwargs are:
Property Description agg_filterunknown alphafloat or None animated[True | False] antialiasedor aa[True | False] or None for default axesan Axesinstancecapstyle[‘butt’ | ‘round’ | ‘projecting’] clip_boxa matplotlib.transforms.Bboxinstanceclip_on[True | False] clip_path[ ( Path,Transform) |Patch| None ]colormatplotlib color spec containsa callable function edgecoloror ecmpl color spec, None, ‘none’, or ‘auto’ facecoloror fcmpl color spec, or None for default, or ‘none’ for no color figurea matplotlib.figure.Figureinstancefill[True | False] gidan id string hatch[‘/’ | ‘\’ | ‘|’ | ‘-‘ | ‘+’ | ‘x’ | ‘o’ | ‘O’ | ‘.’ | ‘*’] joinstyle[‘miter’ | ‘round’ | ‘bevel’] labelstring or anything printable with ‘%s’ conversion. linestyleor ls[‘solid’ | ‘dashed’, ‘dashdot’, ‘dotted’ | (offset, on-off-dash-seq) | '-'|'--'|'-.'|':'|'None'|''|'']linewidthor lwfloat or None for default path_effectsunknown picker[None|float|boolean|callable] rasterized[True | False | None] sketch_paramsunknown snapunknown transformTransforminstanceurla url string visible[True | False] zorderany number
cla()¶Clear the current spine
draw(artist,renderer,*args,**kwargs)¶get_bounds()¶Get the bounds of the spine.
get_patch_transform()¶get_path()¶get_position()¶get the spine position
get_smart_bounds()¶get whether the spine has smart bounds
get_spine_transform()¶get the spine transform
is_frame_like()¶return True if directly on axes frame
This is useful for determining if a spine is the edge of anold style MPL plot. If so, this function will return True.
register_axis(axis)¶register an axis
An axis should be registered with its corresponding spine fromthe Axes instance. This allows the spine to clear any axisproperties when needed.
set_bounds(low,high)¶Set the bounds of the spine.
set_color(c)¶Set the edgecolor.
ACCEPTS: matplotlib color arg or sequence of rgba tuples
See also
set_facecolor(),set_edgecolor()set_patch_circle(center,radius)¶set the spine to be circular
set_patch_line()¶set the spine to be linear
set_position(position)¶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:
set_smart_bounds(value)¶set the spine and associated axis to have smart bounds