Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8977953

Browse files
document labelvisibility on shared axes change (rev1)
1 parent 72d20b0 commit 8977953

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

doc/api/api_changes.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,17 @@ direction) is visible, to avoid making irreversible changes to the figure.
410410
Ticklabels are turned off instead of being invisible
411411
----------------------------------------------------
412412

413-
Internally, :func:`~matplotlib.axis.Axis.set_tick_params` is now used to
414-
hide tick labels instead of setting the visibility on the tick label objects.
413+
Internally, the `Tick`'s :func:`~matplotlib.axis.Tick.label1On` attribute
414+
is now used to hide tick labels instead of setting the visibility on the tick
415+
label objects.
415416
This improves overall performance and fixes some issues.
416-
As a consequence, in case those labels ought to be shown, `set_tick_params`
417-
needs to be used, e.g. `ax.xaxis.set_tick_params(labelbottom=True)`.
417+
As a consequence, in case those labels ought to be shown,
418+
:func:`~matplotlib.axes.Axes.tick_params`
419+
needs to be used, e.g.
420+
421+
::
422+
423+
ax.tick_params(labelbottom=True)
418424

419425

420426
Removal of warning on empty legends

doc/users/prev_whats_new/whats_new_2.1.0.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,22 +395,28 @@ cases.
395395
---------------------------------------------------
396396

397397
Bulk setting of tick label rotation is now possible via
398-
:func:`~matplotlib.axis.Axis.set_tick_params` using the ``rotation``
398+
:func:`~matplotlib.axes.Axes.tick_params` using the ``rotation``
399399
keyword.
400400

401401
::
402402

403-
ax.xaxis.set_tick_params(which='both', rotation=90)
403+
ax.tick_params(which='both', rotation=90)
404404

405405

406406
Ticklabels are turned off instead of being invisible
407407
----------------------------------------------------
408408

409-
Internally, :func:`~matplotlib.axis.Axis.set_tick_params` is now used to
410-
hide tick labels instead of setting the visibility on the tick label objects.
409+
Internally, the `Tick`'s :func:`~matplotlib.axis.Tick.label1On` attribute
410+
is now used to hide tick labels instead of setting the visibility on the tick
411+
label objects.
411412
This improves overall performance and fixes some issues.
412-
As a consequence, in case those labels ought to be shown, `set_tick_params`
413-
needs to be used, e.g. `ax.xaxis.set_tick_params(labelbottom=True)`.
413+
As a consequence, in case those labels ought to be shown,
414+
:func:`~matplotlib.axes.Axes.tick_params`
415+
needs to be used, e.g.
416+
417+
::
418+
419+
ax.tick_params(labelbottom=True)
414420

415421

416422
Shading in 3D bar plots

lib/matplotlib/figure.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,11 +1268,11 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
12681268
labels of the bottom subplot are created. Similarly, when subplots
12691269
have a shared y-axis along a row, only the y tick labels of the
12701270
first column subplot are created. To later turn other subplots'
1271-
ticklabels on, use :meth:`~matplotlib.axis.Axis.set_tick_params`.
1271+
ticklabels on, use :meth:`~matplotlib.axes.Axes.tick_params`.
12721272
12731273
squeeze : bool, optional, default: True
1274-
- If True, extra dimensions are squeezed out from the returned Axes
1275-
object:
1274+
- If True, extra dimensions are squeezed out from the returned
1275+
array of Axes:
12761276
12771277
- if only one subplot is constructed (nrows=ncols=1), the
12781278
resulting single Axes object is returned as a scalar.

lib/matplotlib/pyplot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,11 @@ def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
10151015
labels of the bottom subplot are created. Similarly, when subplots
10161016
have a shared y-axis along a row, only the y tick labels of the first
10171017
column subplot are created. To later turn other subplots' ticklabels
1018-
on, use :meth:`~matplotlib.axis.Axis.set_tick_params`.
1018+
on, use :meth:`~matplotlib.axes.Axes.tick_params`.
10191019
10201020
squeeze : bool, optional, default: True
1021-
- If True, extra dimensions are squeezed out from the returned Axes
1022-
object:
1021+
- If True, extra dimensions are squeezed out from the returned
1022+
array of Axes:
10231023
10241024
- if only one subplot is constructed (nrows=ncols=1), the
10251025
resulting single Axes object is returned as a scalar.

0 commit comments

Comments
 (0)