EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: About matplotlib draw picture
From: 闫芬 <yanfen@sinap.ac.cn>
To: <tech-talk@aps.anl.gov>
Date: Wed, 30 Nov 2011 16:29:30 +0800
Hello everyone:
 
I want to display a array realtime by matplotlib, but It seems there are some errors. Let me explain it in detail:
 
At first creat a array, then change the data every other 2 seconds, at the same time plot the picture every other 2 seconds, the data of picture is from the array.
 
import numpy as np
import matplotlib.pyplot as plt
import time
xx=np.zeros([2,10])
for i in range(10):
    xx[0,i-1]=5*i
    xx[1,i-1]=i
    a=xx[0,:]
    b=xx[1,:]
    print xx
    plt.figure(figsize=(8,4))
    plt.plot(a,b,label="$picture$",color="red",linewidth=2)
    plt.legend()
    plt.show()
    time.sleep(2)
Does anyone who can help me? Thank you very much!
 
Best wishes,
===========================================
Yan Fen
Shanghai Synchrotron Radiation Facility
Shanghai Institute of Applied Physics
Chinese Academy of Sciences
Zhangheng Rd 239,Pudong Dist.,
Shanghai 201204
China
Tel:+86-21-33933225
====================================

Replies:
RE: About matplotlib draw picture Krempasky Juraj

Navigate by Date:
Prev: Re: [help] degree in Computer Science/Software Engineering Pavel Masloff
Next: RE: About matplotlib draw picture Krempasky Juraj
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: measComp R1-0 released Mark Rivers
Next: RE: About matplotlib draw picture Krempasky Juraj
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020