Skip to content

Commit

Permalink
Make offset_line use mpl's duck-typing.
Browse files Browse the repository at this point in the history
Utilises cbook.is_numlike, etc.
  • Loading branch information
dmcdougall committed Jul 14, 2012
1 parent e11e927 commit 26b4255
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/matplotlib/mlab.py
Expand Up @@ -3195,7 +3195,7 @@ def offset_line(y, yerr):
o A tuple of length 2. In this case, yerr[0] is the error below *y* and
yerr[1] is error above *y*.
"""
if np.isscalar(yerr) or len(yerr) == len(y):
if cbook.is_numlike(yerr) or (cbook.iterable(yerr) and len(yerr) == len(y)):
ymin = y - yerr
ymax = y + yerr
elif len(yerr) == 2:
Expand Down

0 comments on commit 26b4255

Please sign in to comment.