From: W. Trevor King Date: Sat, 21 Jul 2012 16:24:50 +0000 (-0400) Subject: Carry on plotting in scripts if one of the plots fails (e.g. for text waves). X-Git-Tag: v0.3~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dadce20a9b0dc33cac556321f0b5f761b64bbb21;p=igor.git Carry on plotting in scripts if one of the plots fails (e.g. for text waves). --- diff --git a/igor/script.py b/igor/script.py index e14db5e..acb1a22 100644 --- a/igor/script.py +++ b/igor/script.py @@ -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):