Math: output dataframe

This commit is contained in:
jfsScience 2020-12-02 15:52:22 +01:00
parent 28762ed524
commit c0e50e6c8c
2 changed files with 15 additions and 3 deletions

View File

@ -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

View File

@ -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()