Permalink
Browse files

Fix type error on boolean test if x or y is a numpy array.

  • Loading branch information...
1 parent f8f0f51 commit 96805b95bea34d34f28e9f2106c945ca322b377c Leif Johnson committed Mar 6, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 scripts/py-grep-plot
View
@@ -330,7 +330,7 @@ def main(args):
color = next(colors)
- if x:
+ if hasattr(x, '__len__') and len(x):
xlo, xhi = min(x), max(x)
if limits['xmin'] is None:
limits['xmin'] = xlo
@@ -339,7 +339,7 @@ def main(args):
limits['xmin'] = min(limits['xmin'], xlo)
limits['xmax'] = max(limits['xmax'], xhi)
- if y:
+ if hasattr(y, '__len__') and len(y):
ylo, yhi = min(y), max(y)
if limits['ymin'] is None:
limits['ymin'] = ylo

0 comments on commit 96805b9

Please sign in to comment.