Only call figure.show if it exits.
[pypiezo.git] / pypiezo / surface.py
index fe096bb89ccb6d806fe6a31295efe7facfcce3dd..6443ea29a5e4562a760e3301239c8a102737dd22 100644 (file)
@@ -236,7 +236,8 @@ def analyze_surface_position_data(
                    fit_fn(final_pos, params)], '-',label='fit')
         #_pylab.legend(loc='best')
         figure.canvas.draw()
-        figure.show()
+        if hasattr(figure, 'show'):
+            figure.show()
         if not _matplotlib.is_interactive():
             _matplotlib_pyplot.show()