Jae-Joon Lee wrote: > 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.
I'm glad you called attention to it; I agree that it needed to be addressed. > > So, if Eric and others have any other thoughts, please speak. I went ahead and committed (svn rev 8054) changes that I think address the problem, and that should slightly improve speed as well in some cases, without slowing anything down in other reasonable cases--unless there are subtleties I am missing. Or maybe I am missing something blatant. In any case, if I have fouled it up, I trust it will soon be evident and the commit can be reverted or fixed. I don't understand what your script, below, is intended to do or show. I haven't run it with mpl prior to my change. With the change, it simply draws a single line, or at least that is all I see on the plot. Eric > 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