@@ -565,6 +565,36 @@ class _AxesBase(martist.Artist):
565
565
dataLim : mtransforms .Bbox
566
566
"""The bounding `.Bbox` enclosing all data displayed in the Axes."""
567
567
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
+
568
598
def __str__ (self ):
569
599
return "{0}({1[0]:g},{1[1]:g};{1[2]:g}x{1[3]:g})" .format (
570
600
type (self ).__name__ , self ._position .bounds )
@@ -677,8 +707,9 @@ def __init__(self, fig,
677
707
self ._colorbars = []
678
708
self .spines = mspines .Spines .from_dict (self ._gen_axes_spines ())
679
709
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
682
713
self ._axis_map = {
683
714
name : getattr (self , f"{ name } axis" ) for name in self ._axis_names
684
715
} # A mapping of axis names, e.g. 'x', to `Axis` instances.
@@ -2212,7 +2243,7 @@ def get_xaxis(self):
2212
2243
.. admonition:: Discouraged
2213
2244
2214
2245
The use of this function is discouraged. You should instead
2215
- directly access the attribute ``ax. xaxis` `.
2246
+ directly access the attribute `~.Axes. xaxis`.
2216
2247
"""
2217
2248
return self .xaxis
2218
2249
@@ -2223,7 +2254,7 @@ def get_yaxis(self):
2223
2254
.. admonition:: Discouraged
2224
2255
2225
2256
The use of this function is discouraged. You should instead
2226
- directly access the attribute ``ax. yaxis` `.
2257
+ directly access the attribute `~.Axes. yaxis`.
2227
2258
"""
2228
2259
return self .yaxis
2229
2260
0 commit comments