MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / linear_spine

Method linear_spine

lib/matplotlib/spines.py:450–466  ·  view source on GitHub ↗

Create and return a linear `Spine`.

(cls, axes, spine_type, **kwargs)

Source from the content-addressed store, hash-verified

448
449 @classmethod
450 def linear_spine(cls, axes, spine_type, **kwargs):
451 """Create and return a linear `Spine`."""
452 # all values of 0.999 get replaced upon call to set_bounds()
453 if spine_type == 'left':
454 path = mpath.Path([(0.0, 0.999), (0.0, 0.999)])
455 elif spine_type == 'right':
456 path = mpath.Path([(1.0, 0.999), (1.0, 0.999)])
457 elif spine_type == 'bottom':
458 path = mpath.Path([(0.999, 0.0), (0.999, 0.0)])
459 elif spine_type == 'top':
460 path = mpath.Path([(0.999, 1.0), (0.999, 1.0)])
461 else:
462 raise ValueError('unable to make path for spine "%s"' % spine_type)
463 result = cls(axes, spine_type, path, **kwargs)
464 result.set_visible(mpl.rcParams[f'axes.spines.{spine_type}'])
465
466 return result
467
468 @classmethod
469 def arc_spine(cls, axes, spine_type, center, radius, theta1, theta2,

Callers 4

_gen_axes_spinesMethod · 0.80
_gen_axes_spinesMethod · 0.80
_gen_axes_spinesMethod · 0.80
_gen_axes_spinesMethod · 0.80

Calls 1

set_visibleMethod · 0.45

Tested by 1

_gen_axes_spinesMethod · 0.64