I think I am using TkAgg but I am not sure, how can I check it?

From: ben.r...@ou.edu
Date: Fri, 27 Aug 2010 21:50:19 -0500
Subject: Re: [Matplotlib-users] realtime plotting was working with matplotlib 
0.99.1.1 and it doesn't with matplotlib 1.0.0
To: chiaracaro...@hotmail.com
CC: matplotlib-users@lists.sourceforge.net

On Fri, Aug 27, 2010 at 9:26 PM, Chiara Caronna <chiaracaro...@hotmail.com> 
wrote:







Hi all,
I have a script to update a plot in real time. It was working fine with 
matplotlib 0.99.1.1 but it doesn't work anymore with the new version. 

Here is the script:

import numpy as n
import pylab as p



x=n.arange(10)
y=n.random.randn(10)
p.ion()
fig=p.figure(1)
ax=fig.add_subplot(111)
line,=ax.plot(x,y,'ko-')
for i in range(10):
    y=n.random.randn(10)
    line.set_data(x,y)
    p.draw()




it is updating the plot correctly with matplotlib 0.99.1.1
when I run it with matplotlib 1.0.0
it doesn't show any picture at all

Interestingly, if I add a line raw_input('ok') then it shows the plot and it 
updates it inside the loop....




x=n.arange(10)
y=n.random.randn(10)
p.ion()
fig=p.figure(1)
ax=fig.add_subplot(111)
line,=ax.plot(x,y,'ko-')
raw_input('ok?')
for i in range(10):
    y=n.random.randn(10)


    line.set_data(x,y)
    p.draw()
    raw_input('ok?')

Any idea why it is doing this? Is it a bug or am I missing something?

Thanks for your help,
Chiara




It seems to work fine for me using the GTKAgg backend.  Which backend are you 
using?  Also, admittedly, this is the trunk build, so it might have some fixes 
that weren't in the release.

Ben Root
                                          
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to