From 4c1fcb8472d10b52fffb50f55ba8a9b2146bf298 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 2 Aug 2012 12:17:21 -0400 Subject: [PATCH] AFM.stepper_approach should only call figure.show if it exits. For example, figures generated with the Agg backend don't have a 'show' method. --- pyafm/afm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyafm/afm.py b/pyafm/afm.py index fc8dacb..60741c6 100644 --- a/pyafm/afm.py +++ b/pyafm/afm.py @@ -486,7 +486,8 @@ class AFM (object): axes.set_title('stepper approach {}'.format(timestamp)) plot = axes.plot(position, deflection, 'b.-') figure.canvas.draw() - figure.show() + if hasattr(figure, 'show'): + figure.show() if not _matplotlib.is_interactive(): _matplotlib_pyplot.show() -- 2.26.2