Thank you for the fast reply, according to you line and "line," shouldt make a difference in this case, i tried the code with line and line, and it only works with line, ?
so you say if i use a=[1,2,3] then b, = a should be 1 ? i just get the error message to many values to unpack ... efiring wrote: > > On 06/15/2011 12:35 PM, jonasr wrote: >> >> hello, >> >> a lot of matplotlib examples i saw included the usage of line, i.e. >> >> from pylab import * >> import time >> >> ion() >> >> tstart = time.time() # for profiling >> x = arange(0,2*pi,0.01) # x-array >> line, = plot(x,sin(x)) >> for i in arange(1,200): >> line.set_ydata(sin(x+i/10.0)) # update the data >> draw() # redraw the canvas >> >> print 'FPS:' , 200/(time.time()-tstart) >> >> can anybody explain to me whats the difference between line and line, ? >> > > plot returns a list of lines, and > > line, = plot(...) > > returns the first one (which in your case is the only one) > > It is the same as > > line = plot(...)[0] > > It is a special case of Python's sequence unpacking, e.g.: > > a, b, c = [1, 2, 3] > > Eric > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/line%2C-tp31855827p31855959.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users