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 e14db5e00b07f16219f3755ea7699014a67f8b32..acb1a22b0fec95ac6bc67d84f4f4d886dec8771e 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):