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

Method __init__

lib/matplotlib/axis.py:640–695  ·  view source on GitHub ↗

Parameters ---------- axes : `~matplotlib.axes.Axes` The `~.axes.Axes` to which the created Axis belongs. pickradius : float The acceptance radius for containment tests. See also `.Axis.contains`. clear : bool, default: Tru

(self, axes, *, pickradius=15, clear=True)

Source from the content-addressed store, hash-verified

638 type(self).__name__, *self.axes.transAxes.transform((0, 0)))
639
640 def __init__(self, axes, *, pickradius=15, clear=True):
641 """
642 Parameters
643 ----------
644 axes : `~matplotlib.axes.Axes`
645 The `~.axes.Axes` to which the created Axis belongs.
646 pickradius : float
647 The acceptance radius for containment tests. See also
648 `.Axis.contains`.
649 clear : bool, default: True
650 Whether to clear the Axis on creation. This is not required, e.g., when
651 creating an Axis as part of an Axes, as ``Axes.clear`` will call
652 ``Axis.clear``.
653 .. versionadded:: 3.8
654 """
655 super().__init__()
656 self._remove_overlapping_locs = True
657
658 self.set_figure(axes.get_figure(root=False))
659
660 self.isDefault_label = True
661
662 self.axes = axes
663 self.major = Ticker()
664 self.minor = Ticker()
665 self.callbacks = cbook.CallbackRegistry(signals=["units"])
666
667 self._autolabelpos = True
668
669 self.label = mtext.Text(
670 np.nan, np.nan,
671 fontsize=mpl.rcParams['axes.labelsize'],
672 fontweight=mpl.rcParams['axes.labelweight'],
673 color=mpl.rcParams['axes.labelcolor'],
674 ) #: The `.Text` object of the axis label.
675
676 self._set_artist_props(self.label)
677 self.offsetText = mtext.Text(np.nan, np.nan)
678 self._set_artist_props(self.offsetText)
679
680 self.labelpad = mpl.rcParams['axes.labelpad']
681
682 self.pickradius = pickradius
683
684 # Initialize here for testing; later add API
685 self._major_tick_kw = dict()
686 self._minor_tick_kw = dict()
687
688 if clear:
689 self.clear()
690 else:
691 self._converter = None
692 self._converter_is_explicit = False
693 self.units = None
694
695 self._autoscale_on = True
696
697 @property

Callers

nothing calls this directly

Calls 6

_set_artist_propsMethod · 0.95
clearMethod · 0.95
TickerClass · 0.85
__init__Method · 0.45
set_figureMethod · 0.45
get_figureMethod · 0.45

Tested by

no test coverage detected