1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 <2011> 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 <2011> 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | About matplotlib draw picture |
From: | 闫芬 <[email protected]> |
To: | <[email protected]> |
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 ==================================== |