Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 850f097

Browse files
committed
Merge remote-tracking branch 'upstream/v1.0.x-maint'
2 parents fcebc23 + 05b4e4c commit 850f097

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/matplotlib/backends/backend_gtk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,14 +548,14 @@ def notify_axes_change(fig):
548548

549549
def destroy(self, *args):
550550
if _debug: print 'FigureManagerGTK.%s' % fn_name()
551+
if hasattr(self, 'toolbar') and self.toolbar is not None:
552+
self.toolbar.destroy()
551553
if hasattr(self, 'vbox'):
552554
self.vbox.destroy()
553555
if hasattr(self, 'window'):
554556
self.window.destroy()
555557
if hasattr(self, 'canvas'):
556558
self.canvas.destroy()
557-
if hasattr(self, 'toolbar'):
558-
self.toolbar.destroy()
559559
self.__dict__.clear() #Is this needed? Other backends don't have it.
560560

561561
if Gcf.get_num_fig_managers()==0 and \

lib/matplotlib/backends/backend_tkagg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ def resize(self, event):
230230

231231
self._tkcanvas.delete(self._tkphoto)
232232
self._tkphoto = Tk.PhotoImage(
233-
master=self._tkcanvas, width=width, height=height)
234-
self._tkcanvas.create_image(width/2,height/2,image=self._tkphoto)
233+
master=self._tkcanvas, width=int(width), height=int(height))
234+
self._tkcanvas.create_image(int(width/2),int(height/2),image=self._tkphoto)
235235
self.resize_event()
236236
self.show()
237237

@@ -545,7 +545,7 @@ def __init__(self, canvas, window):
545545
xmin, xmax = canvas.figure.bbox.intervalx
546546
height, width = 50, xmax-xmin
547547
Tk.Frame.__init__(self, master=self.window,
548-
width=width, height=height,
548+
width=int(width), height=int(height),
549549
borderwidth=2)
550550

551551
self.update() # Make axes menu
@@ -701,7 +701,7 @@ def _init_toolbar(self):
701701
xmin, xmax = self.canvas.figure.bbox.intervalx
702702
height, width = 50, xmax-xmin
703703
Tk.Frame.__init__(self, master=self.window,
704-
width=width, height=height,
704+
width=int(width), height=int(height),
705705
borderwidth=2)
706706

707707
self.update() # Make axes menu

0 commit comments

Comments
 (0)