Only call figure.show if it exits.
[pypiezo.git] / pypiezo / wiggle.py
index 6067ffa6e897e46fe83116d248274561700fa0cf..1f0d705a79807ee601a0852c403551c2cf076f9a 100644 (file)
@@ -138,7 +138,8 @@ def _setup_plot(piezo, config, output):
     axes.set_title('wiggle for interference %s' % timestamp)
     plot = axes.plot(output, output, 'b.-')
     figure.canvas.draw()
-    figure.show()
+    if hasattr(figure, 'show'):
+        figure.show()
     if not _matplotlib.is_interactive():
         _matplotlib_pyplot.show()
     return (figure, axes, plot)