@@ -566,6 +566,36 @@ class _AxesBase(martist.Artist):
566566 dataLim : mtransforms .Bbox
567567 """The bounding `.Bbox` enclosing all data displayed in the Axes."""
568568
569+ xaxis : maxis .XAxis
570+ """
571+ The `.XAxis` instance.
572+
573+ Common axis-related configuration can be achieved through high-level wrapper
574+ methods on Axes; e.g. `ax.set_xticks <.Axes.set_xticks>` is a shortcut for
575+ `ax.xaxis.set_ticks <.Axis.set_ticks>`. The *xaxis* attribute gives direct
576+ direct access to the underlying `~.axis.Axis` if you need more control.
577+
578+ See also
579+
580+ - :ref:`Axis wrapper methods on Axes <axes-api-axis>`
581+ - :doc:`Axis API </api/axis_api>`
582+ """
583+
584+ yaxis : maxis .YAxis
585+ """
586+ The `.YAxis` instance.
587+
588+ Common axis-related configuration can be achieved through high-level wrapper
589+ methods on Axes; e.g. `ax.set_yticks <.Axes.set_yticks>` is a shortcut for
590+ `ax.yaxis.set_ticks <.Axis.set_ticks>`. The *yaxis* attribute gives direct
591+ access to the underlying `~.axis.Axis` if you need more control.
592+
593+ See also
594+
595+ - :ref:`Axis wrapper methods on Axes <axes-api-axis>`
596+ - :doc:`Axis API </api/axis_api>`
597+ """
598+
569599 @property
570600 def _axis_map (self ):
571601 """A mapping of axis names, e.g. 'x', to `Axis` instances."""
@@ -686,9 +716,10 @@ def __init__(self, fig,
686716
687717 # this call may differ for non-sep axes, e.g., polar
688718 self ._init_axis ()
689- if facecolor is None :
690- facecolor = mpl .rcParams ['axes.facecolor' ]
691- self ._facecolor = facecolor
719+ self ._axis_map = {
720+ name : getattr (self , f"{ name } axis" ) for name in self ._axis_names
721+ } # A mapping of axis names, e.g. 'x', to `Axis` instances.
722+ self ._facecolor = mpl ._val_or_rc (facecolor , 'axes.facecolor' )
692723 self ._frameon = frameon
693724 self .set_axisbelow (mpl .rcParams ['axes.axisbelow' ])
694725
@@ -2218,7 +2249,7 @@ def get_xaxis(self):
22182249 .. admonition:: Discouraged
22192250
22202251 The use of this function is discouraged. You should instead
2221- directly access the attribute ``ax. xaxis` `.
2252+ directly access the attribute `~.Axes. xaxis`.
22222253 """
22232254 return self .xaxis
22242255
@@ -2229,7 +2260,7 @@ def get_yaxis(self):
22292260 .. admonition:: Discouraged
22302261
22312262 The use of this function is discouraged. You should instead
2232- directly access the attribute ``ax. yaxis` `.
2263+ directly access the attribute `~.Axes. yaxis`.
22332264 """
22342265 return self .yaxis
22352266
0 commit comments