Start with 3D Printing
This commit is contained in:
parent
0b6069f8c5
commit
8478c6f5f0
23
JFSphoto.py
23
JFSphoto.py
@ -16,6 +16,10 @@ from matplotlib.figure import Figure
|
||||
from numpy import arange, sin, pi,cos
|
||||
import fnmatch
|
||||
import time
|
||||
from matplotlib import cm
|
||||
from matplotlib.ticker import LinearLocator, FormatStrFormatter
|
||||
from mpl_toolkits.mplot3d import Axes3D
|
||||
|
||||
####################################### object
|
||||
|
||||
class Jfsphoto (object):
|
||||
@ -309,6 +313,13 @@ class Jfsphoto (object):
|
||||
|
||||
def do_math(self):
|
||||
stati = [("Raw",1),("Raw + Baseline",2),("Transmission",4),("Absorbanz",3)]
|
||||
def toggle():
|
||||
if self.kbtn.config('relief')[-1] == 'sunken':
|
||||
self.kbtn.config(relief='raised')
|
||||
self.do_2dprint()
|
||||
else:
|
||||
self.kbtn.config(relief='sunken')
|
||||
self.do_3dprint()
|
||||
|
||||
win = tk.Toplevel()
|
||||
self.center = tk.Frame(win, bg='gray2', width=800, height=400, padx=3, pady=3)
|
||||
@ -340,6 +351,8 @@ class Jfsphoto (object):
|
||||
self.kbtn.grid(row=15,column=0,sticky="w")
|
||||
self.kbtn = tk.Button(master=self.ctr_right,text="Save Kinetic / Data",command=self.save_kinetics,width=15)
|
||||
self.kbtn.grid(row=16,column=0,sticky="w")
|
||||
self.kbtn = tk.Button(master=self.ctr_right,text="3 D Print",command=toggle,width=15,relief='raised')
|
||||
self.kbtn.grid(row=17,column=0,sticky="w")
|
||||
|
||||
#self.scrollbar = tk.Scrollbar(master=self.ctr_right)
|
||||
#self.listbox.config(yscrollcommand =self.scrollbar.set)
|
||||
@ -358,6 +371,16 @@ class Jfsphoto (object):
|
||||
win.grab_set()
|
||||
win.wait_window()
|
||||
|
||||
def do_2dprint(self):
|
||||
self.ax1 = self.fig.add_subplot(111)
|
||||
self.look()
|
||||
|
||||
def do_3dprint(self):
|
||||
self.ax1 = self.fig.gca(projection='3d')
|
||||
for xx in self.col_list:
|
||||
self.df.plot(x = 'nmscale',y = xx, zs= int(xx), linewidth=0.6,ax=self.ax1)
|
||||
self.canvas.draw()
|
||||
|
||||
def show_selected(self):
|
||||
self.col_list = [self.listbox.get(i) for i in self.listbox.curselection()]
|
||||
self.look()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user