8000 Fix the error- TypeError: 'float' object is not iterable by krishjainx · Pull Request #22710 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix the error- TypeError: 'float' object is not iterable #22710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 5, 2022
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 = []
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
0