MCPcopy
hub / github.com/matplotlib/matplotlib / __init__

Method __init__

lib/matplotlib/spines.py:36–86  ·  view source on GitHub ↗

Parameters ---------- axes : `~matplotlib.axes.Axes` The `~.axes.Axes` instance containing the spine. spine_type : str The spine type. path : `~matplotlib.path.Path` The `.Path` instance used to draw the spine. Oth

(self, axes, spine_type, path, **kwargs)

Source from the content-addressed store, hash-verified

34
35 @_docstring.interpd
36 def __init__(self, axes, spine_type, path, **kwargs):
37 """
38 Parameters
39 ----------
40 axes : `~matplotlib.axes.Axes`
41 The `~.axes.Axes` instance containing the spine.
42 spine_type : str
43 The spine type.
44 path : `~matplotlib.path.Path`
45 The `.Path` instance used to draw the spine.
46
47 Other Parameters
48 ----------------
49 **kwargs
50 Valid keyword arguments are:
51
52 %(Patch:kwdoc)s
53 """
54 super().__init__(**kwargs)
55 self.axes = axes
56 self.set_figure(self.axes.get_figure(root=False))
57 self.spine_type = spine_type
58 self.set_facecolor('none')
59 self.set_edgecolor(mpl.rcParams['axes.edgecolor'])
60 self.set_linewidth(mpl.rcParams['axes.linewidth'])
61 self.set_capstyle('projecting')
62 self.axis = None
63
64 self.set_zorder(2.5)
65 self.set_transform(self.axes.transData) # default transform
66
67 self._bounds = None # default bounds
68
69 # Defer initial position determination. (Not much support for
70 # non-rectangular axes is currently implemented, and this lets
71 # them pass through the spines machinery without errors.)
72 self._position = None
73 _api.check_isinstance(mpath.Path, path=path)
74 self._path = path
75
76 # To support drawing both linear and circular spines, this
77 # class implements Patch behavior three ways. If
78 # self._patch_type == 'line', behave like a mpatches.PathPatch
79 # instance. If self._patch_type == 'circle', behave like a
80 # mpatches.Ellipse instance. If self._patch_type == 'arc', behave like
81 # a mpatches.Arc instance.
82 self._patch_type = 'line'
83
84 # Behavior copied from mpatches.Ellipse:
85 # Note: This cannot be calculated until this is added to an Axes
86 self._patch_transform = mtransforms.IdentityTransform()
87
88 def set_patch_arc(self, center, radius, theta1, theta2):
89 """Set the spine to be arc-like."""

Callers

nothing calls this directly

Calls 8

set_figureMethod · 0.45
get_figureMethod · 0.45
set_facecolorMethod · 0.45
set_edgecolorMethod · 0.45
set_linewidthMethod · 0.45
set_capstyleMethod · 0.45
set_zorderMethod · 0.45
set_transformMethod · 0.45

Tested by

no test coverage detected