Carry on plotting in scripts if one of the plots fails (e.g. for text waves).
authorW. Trevor King <wking@tremily.us>
Sat, 21 Jul 2012 16:24:50 +0000 (12:24 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 21 Jul 2012 16:24:50 +0000 (12:24 -0400)
igor/script.py

index e14db5e..acb1a22 100644 (file)
@@ -77,7 +77,11 @@ class Script (object):
         figure = _matplotlib_pyplot.figure()
         axes = figure.add_subplot(1, 1, 1)
         axes.set_title(title)
-        axes.plot(wave['wave']['wData'], 'r.')
+        try:
+            axes.plot(wave['wave']['wData'], 'r.')
+        except ValueError as error:
+            _LOG.error('error plotting {}: {}'.format(title, error))
+            pass
         self._num_plots += 1
 
     def display_plots(self):