-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlotPage.py
More file actions
42 lines (29 loc) · 1.53 KB
/
PlotPage.py
File metadata and controls
42 lines (29 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import tkinter as tk
from tkinter import ttk
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
from PageTwo import PageTwo
class PlotPage(tk.Frame):
name = "Plot"
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.contoller = controller
self.width = 2
self.height = 4
self.f = Figure(figsize=(10,5), dpi=100)
self.ax = self.f.add_subplot(111)
label = ttk.Label(self, text="GraphPage", font=18)
label.pack(side="top",fill='both',expand=True)#.grid(row=0, column=0, columnspan=self.width)
buttonMenu = ttk.Button(self, text="Back to Main", command=lambda: controller.show_frame("Main"))
buttonMenu.pack(side="top",fill='both',expand=True)#.grid(row=self.height + 2, column=self.width - 2, sticky="nswe")
buttonDelete = ttk.Button(self, text="Second page", command=lambda: controller.show_frame("Second"))
buttonDelete.pack(side="top",fill='both',expand=True)#.grid(row=self.height + 2, column=self.width - 1, sticky="nswe")
canvas = FigureCanvasTkAgg(self.f, self)
canvas.get_tk_widget().pack(side="top",fill='both',expand=True)#grid(row=2, column=0, rowspan=self.height, columnspan=self.width, sticky="nswe")
self.ax.plot([1, 2, 3, 4, 5],
[1, 2, 3, 4, 5], "o", picker=15)
cid = self.f.canvas.mpl_connect('pick_event', self.on_click)
def on_click(self):
pass
def delete(self):
pass