I’m trying to run a program that plot experimental datas during measurement (to check if experiment is okay). I started doing directly measuring one point and plotting it
import matplotlib
matplotlib.use(‘TkAgg’)
…
from pylab import *
…
ion()
while cond:
measure()
plot(X[-1:],Y[-1:],“o”) #plot data point
- with ipython, the graph stays hidden by the ipython window
lauching by direct double click, it is okay plot is not hidden but after 2 click on the plotting window, it freezes or if I try to move the window, it does not move then the plot window is “not responding” anymore.
I thought I would solve this using a seperate thread for the plot. I tried but no chance
class update_plot(threading.Thread):
def run(self):
global X,Y,end
xlabel(‘X’)
ylabel(‘Y’)
title('Y(X)')
grid(True)
ion()
while end!=1:
plot(X[-1:],Y[-1:],"o")
#show()
time.sleep(0.2)
I’ve seen the FAQ and some few mails in the list, I didn’t really get the way to solve this problem ?
If not possible, maybe I could look for other options for plotting but I wouldn’t like. I’m pretty much accostumed to matplotlib (usually working on linux were there is not that problem or limitation).
At first glance the only matplotlib example that works OK is dynamic_demo_wx.py
I think I shall learn a bit of wxpython and adapt dynamic_demo_wx.py for my case?