Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bbff015

Browse files
committed
DOC: add change note
1 parent ea2d21b commit bbff015

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
``get_ticklabels`` now always populates labels
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Previously `.Axis.get_ticklabels` (and `.Axes.get_xticklabels`,
4+
`.Axes.get_yticklabels`) would only return empty strings unless a draw had
5+
already been performed. Now the ticks and their labels are updated when the
6+
labels are requested.

‎lib/matplotlib/axis.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,13 +1343,6 @@ def get_ticklabels(self, minor=False, which=None):
13431343
Returns
13441344
-------
13451345
list of `~matplotlib.text.Text`
1346-
1347-
Notes
1348-
-----
1349-
The tick label strings are not populated until a ``draw`` method has
1350-
been called.
1351-
1352-
See also: `~.pyplot.draw` and `~.FigureCanvasBase.draw`.
13531346
"""
13541347
if which is not None:
13551348
if which == 'minor':

‎lib/matplotlib/tests/test_axes.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7773,3 +7773,4 @@ def test_get_xticklabel():
77737773
ax.plot(np.arange(10))
77747774
for ind in range(10):
77757775
assert ax.get_xticklabels()[ind].get_text() == f'{ind}'
7776+
assert ax.get_yticklabels()[ind].get_text() == f'{ind}'

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /