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

Skip to content

Commit 235656a

Browse files
author
James Evans
committed
Fixed a bug in units.py where is_numlike was iterating over a list and calling
is_numlike with the list as the parameter instead of the individual value. This was actually not returning correct values when a list was passed in. Modified axis.set_unit to not attempt to determine the converter to use based on the specified unit since a unit is not necessarily an instance of the type to be converted. The removed lines were made redundant due to a previous submission. svn path=/trunk/matplotlib/; revision=3256
1 parent e13798d commit 235656a

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

lib/matplotlib/axis.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -848,9 +848,6 @@ def set_units(self, u):
848848
if u!=self.units:
849849
self.units = u
850850
#print 'setting units', self.converter, u, units.registry.get_converter(u)
851-
if self.converter is None:
852-
self.converter = units.registry.get_converter(u)
853-
self._update_axisinfo()
854851
pchanged = True
855852
if pchanged:
856853
self.callbacks.process('units')

lib/matplotlib/units.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def is_numlike(x):
100100
"""
101101
if iterable(x):
102102
for thisx in x:
103-
return is_numlike(x)
103+
return is_numlike(thisx)
104104
else:
105105
return is_numlike(x)
106106
is_numlike = staticmethod(is_numlike)

0 commit comments

Comments
 (0)