Create and return a linear `Spine`.
(cls, axes, spine_type, **kwargs)
| 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, |