diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-04-06 16:09:18 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-04-06 16:09:18 -0400 |
commit | bfe0860fa9c3b33929d5cb05e1d14d19afc5f968 (patch) | |
tree | 48b60db08c565f4351c21ce86d50c81561aa95e9 | |
parent | 8eaeccf4491dce1338cf3f6edee564e7f3943b83 (diff) | |
download | pyExpControl-bfe0860fa9c3b33929d5cb05e1d14d19afc5f968.tar.gz pyExpControl-bfe0860fa9c3b33929d5cb05e1d14d19afc5f968.zip |
some plotting speed up
-rw-r--r-- | panel.py | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -177,6 +177,9 @@ class Experiment: self.cntrlPannel=ttk.LabelFrame(root, text='controls') self.cntrlPannel.pack() + self.bAutoZoom=Button(self.cntrlPannel,text="AutoZoom",command=self.autoZoom,font=('Arial','24')) + self.bAutoZoom.pack(side='left') + self.bRestart=Button(self.cntrlPannel,text="RESTART",command=self.restart,font=('Arial','24')) self.bRestart.pack(side='left') @@ -248,16 +251,22 @@ class Experiment: runTime = (stop-start).seconds + float((stop-start).microseconds)/1000000 # print("onTic DAQ took %s seconds." % (runTime) ) - def updatePlot(self,swp=None): - start = datetime.now() + def autoZoom(self): self.ax.cla() self.line, = self.ax.plot(self.data['tic'], self.data['ch1'], '.') + self.canvas.draw() + + def updatePlot(self,swp=None): + start = datetime.now() + # self.ax.cla() + # self.line, = self.ax.plot(self.data['tic'], self.data['ch1'], '.') # t = Thread(target=self.canvas.draw) - # self.line.set_data([1, 2, 3], [1, 2, 3]) - # self.ax.draw_artist(self.line) + # self.line.set_data([.1, .2, .3], [.1, .2, .3]) + self.line.set_data(self.data['tic'], self.data['ch1']) + self.ax.draw_artist(self.line) # self.canvas.update() - self.canvas.draw() - # self.fig.canvas.flush_events() + # self.canvas.draw() + self.fig.canvas.flush_events() stop = datetime.now() runTime = (stop-start).seconds + float((stop-start).microseconds)/1000000 print("Replot took %s seconds to plot %s points." % (runTime, len(self.data['ch1'])) ) |