Skip to content
Next Next commit
Update axis.py
  • Loading branch information
krishjainx authored Mar 26, 2022
commit d03c676238e0205f5cc1e0e3574b06f499e31fb6
6 changes: 4 additions & 2 deletions lib/matplotlib/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1825,8 +1825,10 @@ def set_ticklabels(self, ticklabels, *, minor=False, **kwargs):
For each tick, includes ``tick.label1`` if it is visible, then
``tick.label2`` if it is visible, in that order.
"""
ticklabels = [t.get_text() if hasattr(t, 'get_text') else t
for t in ticklabels]
ticklabels = []
Comment thread
krishjainx marked this conversation as resolved.
Outdated
for t in ticklabels:
if hasattr(t, 'get_text'):
ticklabels.append(t.get_text())
locator = (self.get_minor_locator() if minor
else self.get_major_locator())
if isinstance(locator, mticker.FixedLocator):
Expand Down