On Sun, Dec 27, 2009 at 2:37 PM, Eric Firing <efir...@hawaii.edu> wrote:
> What are the circumstances under which one would call set_data() and not
> want or need an update?

If you ask me, I'm +1 to update the plot always. But, apparently, the
original author of this code wanted to do some checks to avoid
unnecessary recaching. So, I'm not sure which is better.

On the other hand, I think there is a general issue of whether the
current behavior of the cache is broken or not. In the code below,
the function test_cache() gives different results depending on the
input is a list or a numpy array. And, to me, this is something that
needs to be fixed despite it may add a little bit of complication into
the code.

I did not want to step into this issue as I didn't write the code, but
there has been no responses from other developers while this issue (I
mean, the original issue of set_data not updating the plot) has been
raised a few times in the mailing list.

So, if Eric and others have any other thoughts, please speak.
Regards,

-JJ


from matplotlib.pyplot import subplot, show
import numpy as np
import matplotlib.lines as mlines

def test_cache(ax, yy):
    l = mlines.Line2D([0, 1], yy)
    yy[1]=0.7
    ax.add_line(l)

ax = subplot(111)
a1 = [0, 1]
test_cache(ax, a1)
a2 = np.array([0, 1], dtype="d")
test_cache(ax, a2)

show()

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to