@@ -2019,26 +2019,30 @@ def axis(self, arg=None, /, *, emit=True, **kwargs):
2019
2019
If a bool, turns axis lines and labels on or off. If a string,
2020
2020
possible values are:
2021
2021
2022
- ======== ==========================================================
2023
- Value Description
2024
- ======== ==========================================================
2025
- 'on' Turn on axis lines and labels. Same as ``True``.
2026
- 'off' Turn off axis lines and labels. Same as ``False``.
2027
- 'equal' Set equal scaling (i.e., make circles circular) by
2028
- changing axis limits. This is the same as
2029
- ``ax.set_aspect('equal', adjustable='datalim')``.
2030
- Explicit data limits may not be respected in this case.
2031
- 'scaled' Set equal scaling (i.e., make circles circular) by
2032
- changing dimensions of the plot box. This is the same as
2033
- ``ax.set_aspect('equal', adjustable='box', anchor='C')``.
2034
- Additionally, further autoscaling will be disabled.
2035
- 'tight' Set limits just large enough to show all data, then
2036
- disable further autoscaling.
2037
- 'auto' Automatic scaling (fill plot box with data).
2038
- 'image' 'scaled' with axis limits equal to data limits.
2039
- 'square' Square plot; similar to 'scaled', but initially forcing
2040
- ``xmax-xmin == ymax-ymin``.
2041
- ======== ==========================================================
2022
+ ================ ===========================================================
2023
+ Value Description
2024
+ ================ ===========================================================
2025
+ 'off' or `False` Hide all axis decorations, i.e. axis labels, spines,
2026
+ tick marks, tick labels, and grid lines.
2027
+ This is the same as `~.Axes.set_axis_off()`.
2028
+ 'on' or `True` Do not hide all axis decorations, i.e. axis labels, spines,
2029
+ tick marks, tick labels, and grid lines.
2030
+ This is the same as `~.Axes.set_axis_on()`.
2031
+ 'equal' Set equal scaling (i.e., make circles circular) by
2032
+ changing the axis limits. This is the same as
2033
+ ``ax.set_aspect('equal', adjustable='datalim')``.
2034
+ Explicit data limits may not be respected in this case.
2035
+ 'scaled' Set equal scaling (i.e., make circles circular) by
2036
+ changing dimensions of the plot box. This is the same as
2037
+ ``ax.set_aspect('equal', adjustable='box', anchor='C')``.
2038
+ Additionally, further autoscaling will be disabled.
2039
+ 'tight' Set limits just large enough to show all data, then
2040
+ disable further autoscaling.
2041
+ 'auto' Automatic scaling (fill plot box with data).
2042
+ 'image' 'scaled' with axis limits equal to data limits.
2043
+ 'square' Square plot; similar to 'scaled', but initially forcing
2044
+ ``xmax-xmin == ymax-ymin``.
2045
+ ================ ===========================================================
2042
2046
2043
2047
emit : bool, default: True
2044
2048
Whether observers are notified of the axis limit change.
@@ -3391,18 +3395,25 @@ def tick_params(self, axis='both', **kwargs):
3391
3395
3392
3396
def set_axis_off (self ):
3393
3397
"""
3394
- Turn the x- and y-axis off .
3398
+ Hide all visual components of the x- and y-axis.
3395
3399
3396
- This affects the axis lines, ticks, ticklabels, grid and axis labels.
3400
+ This sets a flag to suppress drawing of all axis decorations, i.e.
3401
+ axis labels, axis spines, and the axis tick component (tick markers,
3402
+ tick labels, and grid lines). Individual visibility settings of these
3403
+ components are ignored as long as `set_axis_off()` is in effect.
3397
3404
"""
3398
3405
self .axison = False
3399
3406
self .stale = True
3400
3407
3401
3408
def set_axis_on (self ):
3402
3409
"""
3403
- Turn the x- and y-axis on .
3410
+ Do not hide all visual components of the x- and y-axis.
3404
3411
3405
- This affects the axis lines, ticks, ticklabels, grid and axis labels.
3412
+ This reverts the effect of a prior `.set_axis_off()` call. Whether the
3413
+ individual axis decorations are drawn is controlled by their respective
3414
+ visibility settings.
3415
+
3416
+ This is on by default.
3406
3417
"""
3407
3418
self .axison = True
3408
3419
self .stale = True
@@ -3649,7 +3660,8 @@ def set_xlim(self, left=None, right=None, *, emit=True, auto=False,
3649
3660
get_xscale = _axis_method_wrapper ("xaxis" , "get_scale" )
3650
3661
set_xscale = _axis_method_wrapper ("xaxis" , "_set_axes_scale" )
3651
3662
get_xticks = _axis_method_wrapper ("xaxis" , "get_ticklocs" )
3652
- set_xticks = _axis_method_wrapper ("xaxis" , "set_ticks" )
3663
+ set_xticks = _axis_method_wrapper ("xaxis" , "set_ticks" ,
3664
+ doc_sub = {'set_ticks' : 'set_xticks' })
3653
3665
get_xmajorticklabels = _axis_method_wrapper ("xaxis" , "get_majorticklabels" )
3654
3666
get_xminorticklabels = _axis_method_wrapper ("xaxis" , "get_minorticklabels" )
3655
3667
get_xticklabels = _axis_method_wrapper ("xaxis" , "get_ticklabels" )
@@ -3880,7 +3892,8 @@ def set_ylim(self, bottom=None, top=None, *, emit=True, auto=False,
3880
3892
get_yscale = _axis_method_wrapper ("yaxis" , "get_scale" )
3881
3893
set_yscale = _axis_method_wrapper ("yaxis" , "_set_axes_scale" )
3882
3894
get_yticks = _axis_method_wrapper ("yaxis" , "get_ticklocs" )
3883
- set_yticks = _axis_method_wrapper ("yaxis" , "set_ticks" )
3895
+ set_yticks = _axis_method_wrapper ("yaxis" , "set_ticks" ,
3896
+ doc_sub = {'set_ticks' : 'set_yticks' })
3884
3897
get_ymajorticklabels = _axis_method_wrapper ("yaxis" , "get_majorticklabels" )
3885
3898
get_yminorticklabels = _axis_method_wrapper ("yaxis" , "get_minorticklabels" )
3886
3899
get_yticklabels = _axis_method_wrapper ("yaxis" , "get_ticklabels" )
0 commit comments