@@ -565,6 +565,36 @@ class _AxesBase(martist.Artist):
565565 dataLim : mtransforms .Bbox
566566 """The bounding `.Bbox` enclosing all data displayed in the Axes."""
567567
568+ xaxis : maxis .XAxis
569+ """
570+ The `.XAxis` instance.
571+
572+ Common axis-related configuration can be achieved through high-level wrapper
573+ methods on Axes; e.g. `ax.set_xticks <.Axes.set_xticks>` is a shortcut for
574+ `ax.xaxis.set_ticks <.axis.Axis.set_ticks>`. The *xaxis* attribute gives direct
575+ direct access to the underlying `.Axis` if you need more control.
576+
577+ See also
578+
579+ - :ref:`Axis wrapper methods on Axes <axes-api-axis>`
580+ - :doc:`Axis API </api/axis_api>`
581+ """
582+
583+ yaxis : maxis .YAxis
584+ """
585+ The `.YAxis` instance.
586+
587+ Common axis-related configuration can be achieved through high-level wrapper
588+ methods on Axes; e.g. `ax.set_yticks <.Axes.set_yticks>` is a shortcut for
589+ `ax.yaxis.set_ticks <.axis.Axis.set_ticks>`. The *yaxis* attribute gives direct
590+ access to the underlying `.Axis` if you need more control.
591+
592+ See also
593+
594+ - :ref:`Axis wrapper methods on Axes <axes-api-axis>`
595+ - :doc:`Axis API </api/axis_api>`
596+ """
597+
568598 def __str__ (self ):
569599 return "{0}({1[0]:g},{1[1]:g};{1[2]:g}x{1[3]:g})" .format (
570600 type (self ).__name__ , self ._position .bounds )
@@ -677,8 +707,9 @@ def __init__(self, fig,
677707 self ._colorbars = []
678708 self .spines = mspines .Spines .from_dict (self ._gen_axes_spines ())
679709
680- # this call may differ for non-sep axes, e.g., polar
681- self ._init_axis ()
710+ self .xaxis = None # will be populated in _init_axis()
711+ self .yaxis = None # will be populated in _init_axis()
712+ self ._init_axis () # this call may differ for non-sep axes, e.g., polar
682713 self ._axis_map = {
683714 name : getattr (self , f"{ name } axis" ) for name in self ._axis_names
684715 } # A mapping of axis names, e.g. 'x', to `Axis` instances.
@@ -2212,7 +2243,7 @@ def get_xaxis(self):
22122243 .. admonition:: Discouraged
22132244
22142245 The use of this function is discouraged. You should instead
2215- directly access the attribute ``ax. xaxis` `.
2246+ directly access the attribute `~.Axes. xaxis`.
22162247 """
22172248 return self .xaxis
22182249
@@ -2223,7 +2254,7 @@ def get_yaxis(self):
22232254 .. admonition:: Discouraged
22242255
22252256 The use of this function is discouraged. You should instead
2226- directly access the attribute ``ax. yaxis` `.
2257+ directly access the attribute `~.Axes. yaxis`.
22272258 """
22282259 return self .yaxis
22292260
0 commit comments