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

Skip to content

Commit 3f73d58

Browse files
jklymakandrew-fennell
authored andcommitted
ENH: update ticks when requesting labels
1 parent 5933662 commit 3f73d58

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/axis.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,13 +1312,15 @@ def get_pickradius(self):
13121312

13131313
def get_majorticklabels(self):
13141314
"""Return this Axis' major tick labels, as a list of `~.text.Text`."""
1315+
self._update_ticks()
13151316
ticks = self.get_major_ticks()
13161317
labels1 = [tick.label1 for tick in ticks if tick.label1.get_visible()]
13171318
labels2 = [tick.label2 for tick in ticks if tick.label2.get_visible()]
13181319
return labels1 + labels2
13191320

13201321
def get_minorticklabels(self):
13211322
"""Return this Axis' minor tick labels, as a list of `~.text.Text`."""
1323+
self._update_ticks()
13221324
ticks = self.get_minor_ticks()
13231325
labels1 = [tick.label1 for tick in ticks if tick.label1.get_visible()]
13241326
labels2 = [tick.label2 for tick in ticks if tick.label2.get_visible()]

0 commit comments

Comments
 (0)