Permalink
Browse files

Make `offset_line` use mpl's duck-typing.

Utilises cbook.is_numlike, etc.
  • Loading branch information...
1 parent e11e927 commit 26b4255f91ceb31eaf3e646454d2666a3c885b6f @dmcdougall committed Jul 14, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/matplotlib/mlab.py
View
@@ -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:

0 comments on commit 26b4255

Please sign in to comment.