Index: src/sas/plottools/canvas.py
===================================================================
--- src/sas/plottools/canvas.py	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/plottools/canvas.py	(revision 2df0b74178c150a9f521d5b09abf522c0578e825)
@@ -5,7 +5,6 @@
 import wx
 import sys
+import logging
 from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
-from matplotlib.backends.backend_wxagg import _convert_agg_to_wx_bitmap
-from matplotlib.backends.backend_agg import FigureCanvasAgg
 from matplotlib.backend_bases import MouseEvent, RendererBase
 from matplotlib.backends.backend_wx import GraphicsContextWx, PrintoutWx
@@ -48,11 +47,11 @@
     dc = self.GetDC()
     try:
-        (ppw, pph) = self.GetPPIPrinter()      # printer's pixels per in
+        (ppw, pph) = self.GetPPIPrinter()  # printer's pixels per in
     except:
         ppw = 1
         pph = 1
-    (pgw, pgh) = self.GetPageSizePixels()  # page size in pixels
-    (dcw, dch) = dc.GetSize()
-    (grw, grh) = self.canvas.GetSizeTuple()
+    (pgw, _) = self.GetPageSizePixels()  # page size in pixels
+    (dcw, _) = dc.GetSize()
+    (grw, _) = self.canvas.GetSizeTuple()
 
     # save current figure dpi resolution and bg color,
@@ -78,5 +77,5 @@
     page_scale = 1.0
     if self.IsPreview():
-        page_scale = float(dcw)/pgw
+        page_scale = float(dcw) / pgw
 
     # get margin in pixels = (margin in in) * (pixels/in)
@@ -97,9 +96,9 @@
             dc.DrawBitmap(self.canvas.bitmap, (0, 0))
         except:
-            pass
+            logging.error(sys.exc_value)
 
     # restore original figure  resolution
     self.canvas.figure.set_facecolor(bgcolor)
-    ## used to be self.canvas.figure.dpi.set( fig_dpi)
+    # # used to be self.canvas.figure.dpi.set( fig_dpi)
     self.canvas.figure.dpi = fig_dpi
     self.canvas.draw()
@@ -121,5 +120,5 @@
         super(FigureCanvas, self).__init__(*args, **kw)
         self._isRendered = False
-        
+
         # Create an timer for handling draw_idle requests
         # If there are events pending when the timer is
@@ -136,5 +135,5 @@
         # Support for mouse wheel
         self.Bind(wx.EVT_MOUSEWHEEL, self._onMouseWheel)
-       
+
     def set_panel(self, panel):
         """
@@ -146,5 +145,5 @@
         self.xaxis = panel.subplot.xaxis
         self.yaxis = panel.subplot.yaxis
-        
+
     def draw_idle(self, *args, **kwargs):
         """
@@ -165,5 +164,5 @@
             self.draw(*args, **kwargs)
             self.resizing = False
-            
+
     def _get_axes_switch(self):
         """
@@ -184,5 +183,5 @@
         # set the resizing back to default= False
         self.set_resizing(False)
-        
+
     def set_resizing(self, resizing=False):
         """
@@ -191,5 +190,5 @@
         self.resizing = resizing
         self.panel.set_resizing(False)
-             
+
     def draw(self, drawDC=None):
         """
@@ -203,22 +202,19 @@
             self._isRendered = True
             self._get_axes_switch()
-            #import time
-            #st = time.time()
+            # import time
+            # st = time.time()
             try:
                 fig.draw(self)
             except ValueError:
-                pass
-            #self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None)
-            #self.gui_repaint(drawDC=drawDC)
-            #print "time", time.time() - st
+                logging.error(sys.exc_value)
         else:
             self._isRendered = False
         if self.ndraw <= 1:
             self.ndraw += 1
-        
+
     def _onMouseWheel(self, evt):
         """Translate mouse wheel events into matplotlib events"""
         # Determine mouse location
-        w, h = self.figure.canvas.get_width_height()
+        _, h = self.figure.canvas.get_width_height()
         x = evt.GetX()
         y = h - evt.GetY()
@@ -228,5 +224,5 @@
         rotation = evt.GetWheelRotation()
         rate = evt.GetLinesPerAction()
-        #print "delta,rotation,rate",delta,rotation,rate
+        # print "delta,rotation,rate",delta,rotation,rate
         step = rate * float(rotation) / delta
 
@@ -249,12 +245,12 @@
         if step != 0:
             self.panel.is_zoomed = True
-               
+
     def _onRightButtonDown(self, evt):
         """
         Overload the right button down call back to avoid a problem
         with the context menu over matplotlib plots on linux.
-        
+
         :TODO: Investigate what the root cause of the problem is.
-        
+
         """
         if sys.platform == 'linux2' or self.panel.dimension == 3:
@@ -271,3 +267,3 @@
     def _onLeave(self, evt):
         if self.HasCapture(): self.ReleaseMouse()
-        super(FigureCanvas,self)._onLeave(evt)
+        super(FigureCanvas, self)._onLeave(evt)
