File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def default_units(x, axis):
4444from __future__ import (absolute_import , division , print_function ,
4545 unicode_literals )
4646
47- from matplotlib .cbook import iterable , is_numlike
47+ from matplotlib .cbook import iterable , is_numlike , safe_first_element
4848import numpy as np
4949
5050
@@ -155,14 +155,11 @@ def get_converter(self, x):
155155 converter = self .get_converter (next_item )
156156 return converter
157157
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
166163
167164 # DISABLED self._cached[idx] = converter
168165 return converter
You can’t perform that action at this time.
0 commit comments