File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def default_units(x, axis):
44
44
from __future__ import (absolute_import , division , print_function ,
45
45
unicode_literals )
46
46
47
- from matplotlib .cbook import iterable , is_numlike
47
+ from matplotlib .cbook import iterable , is_numlike , safe_first_element
48
48
import numpy as np
49
49
50
50
@@ -155,14 +155,11 @@ def get_converter(self, x):
155
155
converter = self .get_converter (next_item )
156
156
return converter
157
157
158
- if converter is None and iterable (x ):
159
- for thisx in x :
160
- # Make sure that recursing might actually lead to a solution,
161
- # if we are just going to re-examine another item of the same
162
- # kind, then do not look at it.
163
- if classx and classx != getattr (thisx , '__class__' , None ):
164
- converter = self .get_converter (thisx )
165
- return converter
158
+ if converter is None and iterable (x ) and (len (x ) > 0 ):
159
+ thisx = safe_first_element (x )
160
+ if classx and classx != getattr (thisx , '__class__' , None ):
161
+ converter = self .get_converter (thisx )
162
+ return converter
166
163
167
164
# DISABLED self._cached[idx] = converter
168
165
return converter
You can’t perform that action at this time.
0 commit comments