diff --git a/CCDpanelsetup.py b/CCDpanelsetup.py index 4cd6ccb..66f3d79 100644 --- a/CCDpanelsetup.py +++ b/CCDpanelsetup.py @@ -295,7 +295,7 @@ class buildpanel(tk.Frame): self.jfspkine2 = tk.Entry(self.jfslf1,width=4) self.jfspkine2.grid(row=1,column=1,sticky='e') - self.jfspdmath = tk.Button(self,text='Math..',fg="blue", command=loaddata) + self.jfspdmath = tk.Button(self,text='Math..',fg="blue", command=self.jf.do_math) self.jfspdmath.grid(row=save_row,column=4,sticky='e') ### Reset changes from loading phometerfile diff --git a/JFSphoto.py b/JFSphoto.py index 7ac757b..6b810d1 100644 --- a/JFSphoto.py +++ b/JFSphoto.py @@ -8,6 +8,11 @@ import numpy as np from configparser import ConfigParser import pandas as pd import config + +import matplotlib.pyplot as plt +#matplotlib.use("TkAgg") +from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg +from matplotlib.figure import Figure ####################################### object class Jfsphoto (object): @@ -265,5 +270,12 @@ class Jfsphoto (object): except IOError: print("By the great otter!","No config.ini file") - - + def do_math(self): + root = tk.Tk() + root.title("Mathoptions") + fig = plt.Figure(figsize=(8,4),dpi=100) + ax1 = fig.add_subplot(111) + self.df.plot(x = 'nmscale',y = 'p1', color='red',linewidth=0.6,ax=ax1) + canvas = FigureCanvasTkAgg(fig, master = root) + canvas._tkcanvas.pack(side = tk.TOP, fill = tk.BOTH, expand = 1) + root.mainloop() \ No newline at end of file