Skip to content
Snippets Groups Projects
Commit de646d72 authored by Leonardo Martinez Hornak's avatar Leonardo Martinez Hornak
Browse files

Static plot added

parent 2344f61b
Branches
Tags
No related merge requests found
import tkinter as tk
import matplotlib.pyplot as plt
import numpy as np
from tkinter import TOP, BOTH, X, LEFT, RIGHT
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
class Application(tk.Frame):
def __init__(self, master=None):
......@@ -19,13 +23,22 @@ class Application(tk.Frame):
self.label_title = tk.Label(self.frame_one, text = "Smart Watch")
self.label_title.pack(side=LEFT)
#FRAME 2
#FRAME 2 - GRAPH
self.frame_two = tk.Frame(self.master)
self.frame_two.pack(fill=X)
self.label_subtitle_one = tk.Label(self.frame_two, text = "GRAFICO")
self.label_subtitle_one.pack(side=LEFT)
#TODO Add chart
figure = plt.Figure(figsize=(6,5), dpi=100)
ax = figure.add_subplot(111)
chart_type = FigureCanvasTkAgg(figure, self.frame_two)
chart_type.get_tk_widget().pack()
x = np.arange(10)
y = 2.5 * np.sin(x / 20 * np.pi)
ax.plot(x, y, color='tab:blue')
ax.set_xlim([0, 10])
ax.set_ylim([-1, 1])
ax.set_title('PPG - RED')
#FRAME 3
self.frame_three = tk.Frame(self.master)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment