Only call figure.show if it exits.
[pypiezo.git] / pypiezo / afm.py
index 7e840f61296701ee9a0bdd7d29521b50b1d39942..6e00347a26e6f2195148407750a1c5ee919ff8a4 100644 (file)
@@ -260,7 +260,8 @@ class AFMPiezo (_base.Piezo):
             axes.plot(pos_array, def_array, '.', label=timestamp)
             #_pylab.legend(loc='best')
             figure.canvas.draw()
-            figure.show()
+            if hasattr(figure, 'show'):
+                figure.show()
             if not _matplotlib.is_interactive():
                 _matplotlib_pyplot.show()