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

Skip to content

Commit 34737d9

Browse files
committed
PEP8 conformity; removed outcommented code
1 parent 0b73eda commit 34737d9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

examples/user_interfaces/embedding_in_tk2.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
matplotlib.use('TkAgg')
44

55
from numpy import arange, sin, pi
6-
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
6+
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
77
from matplotlib.figure import Figure
88

99
import sys
@@ -12,19 +12,20 @@
1212
else:
1313
import tkinter as Tk
1414

15-
def destroy(e): sys.exit()
15+
16+
def destroy(e):
17+
sys.exit()
1618

1719
root = Tk.Tk()
1820
root.wm_title("Embedding in TK")
19-
#root.bind("<Destroy>", destroy)
2021

2122

22-
f = Figure(figsize=(5,4), dpi=100)
23+
f = Figure(figsize=(5, 4), dpi=100)
2324
a = f.add_subplot(111)
24-
t = arange(0.0,3.0,0.01)
25+
t = arange(0.0, 3.0, 0.01)
2526
s = sin(2*pi*t)
2627

27-
a.plot(t,s)
28+
a.plot(t, s)
2829
a.set_title('Tk embedding')
2930
a.set_xlabel('X axis label')
3031
a.set_ylabel('Y label')
@@ -35,8 +36,6 @@ def destroy(e): sys.exit()
3536
canvas.show()
3637
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
3738

38-
#toolbar = NavigationToolbar2TkAgg( canvas, root )
39-
#toolbar.update()
4039
canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
4140

4241
button = Tk.Button(master=root, text='Quit', command=sys.exit)

0 commit comments

Comments
 (0)