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

Skip to content

FIX: slow plots of pandas objects (Second try) #6997

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 1 commit into from
Aug 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions lib/matplotlib/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def default_units(x, axis):
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from matplotlib.cbook import iterable, is_numlike
from matplotlib.cbook import iterable, is_numlike, safe_first_element
import numpy as np


Expand Down Expand Up @@ -155,14 +155,11 @@ def get_converter(self, x):
converter = self.get_converter(next_item)
return converter

if converter is None and iterable(x):
for thisx in x:
# Make sure that recursing might actually lead to a solution,
# if we are just going to re-examine another item of the same
# kind, then do not look at it.
if classx and classx != getattr(thisx, '__class__', None):
converter = self.get_converter(thisx)
return converter
if converter is None and iterable(x) and (len(x) > 0):
thisx = safe_first_element(x)
if classx and classx != getattr(thisx, '__class__', None):
converter = self.get_converter(thisx)
return converter

# DISABLED self._cached[idx] = converter
return converter
Expand Down