from numpy import * import pyqtgraph as pg ## Switch to using white background and black foreground pg.setConfigOption('background', 'w') pg.setConfigOption('foreground', 'k') ## Get DATA F=load('tEvol.npz') # $HOME, extention is .npz ! #### CREATE WINDOW win=pg.GraphicsWindow(title="Measured variables")# <=== win.resize(600,600)# <=== ####### FIRST PLOT ######## if len(F['x'])>1: N= len(F['x']) # the number of points ttl="file %s N=%d"%("test",N) p1=win.addPlot(title=ttl) # <=== p1.plot(F['x'],pen=(0,0,0))# <=== ########## SECOND PLOT #################### print(len(F['Q'])) if len(F['Q'])>1: N= len(F['Q']) # the number of points MP=F['Q'] ttl="Network Membrane Potential" p4=win.addPlot(title=ttl) # <=== p4.plot(MP,pen=(0,0,0)) # <=== p4.setLabel('left','membrane potential',units='mV')# <=== p4.setLabel('bottom','time (msec)') # <=== #### THIRD PLOT #### Tot=N/1000. # Total time in sec tp=range(N-1) # numerical time vector ti=Tot/N # Time interval in msec #t=ti*tp # physical time vector A=fft.rfft(MP) TauNq=(1/(2.*ti)) # frequency step f=TauNq*linspace(0,1,N/2) A[0]=0 fft=abs(A[0:N/2]) win.nextRow()# <=== p5=win.addPlot(title="Fourier Spectrum")# <=== p5.plot(f,fft,pen=(0,0,0))# <=== p5.setLabel('bottom','frequency',units='Hz')# <=== pg.QtGui.QApplication.exec_()# <===