Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from Tkinter import *
- import pandas as pd
- import matplotlib.pyplot as plt
- import numpy as np
- class App:
- def __init__(self, master):
- master.minsize(width=666, height=666)
- frame = Frame(master)
- frame.pack()
- self.button = Button(frame, text="KONEC", fg="red", command=master.destroy)
- self.button.pack(side=LEFT)
- self.hi_there = Button(frame, text="Vykresli", command=self.vykresli)
- self.hi_there.pack(side=LEFT)
- def udaj(self):
- L1=Label(top, text="Enter filename, faggot")
- L1.pack(side=LEFT)
- E1=Entry(top,bd=5)
- E1.pack(side=RIGHT)
- top.mainloop()
- def vykresli(self):
- csv = pd.read_csv(E1)
- data=csv[['deformacia','napatie']]
- data=data.astype(float)
- x=data['deformacia']
- y=data['napatie']
- plt.scatter(x,y,s=0.5)
- #toto fituje krivku k bodom.
- fit=np.polyfit(x,y,15)
- p=np.poly1d(fit)
- plt.plot(x,p(x),"r--")
- plt.show()
- if __name__=="__main__":
- root = Tk()
- app = App(root)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement