On Tue, Aug 4, 2009 at 2:27 PM, Michael Droettboom <md...@stsci.edu> wrote:

>
> Gökhan Sever wrote:
>
>>
>> I see a little change when I typed them in Ipython, however not exactly
>> sure the real reasoning behind this.
>>
>> In [4]: lines = ax.plot(t, y1, lw=2, color='red', label='1 hz')
>>
>> In [5]: lines
>> Out[5]: [<matplotlib.lines.Line2D object at 0xabce76c>]
>>
> Here the variable lines is a list with one element (a Line2D object).
>
>>
>> In [6]: lines, = ax.plot(t, y1, lw=2, color='red', label='1 hz')
>>
>> In [7]: lines
>> Out[7]: <matplotlib.lines.Line2D object at 0xabceaec>
>>
> Here lines is a Line2D object.
>
> ax.plot always returns a list because it may plot more than one line.  The
> choice of syntax for the caller of the function is just for convenience.
>  One could just as easily do:


Yeah, it's a nice little feature of python:

t = (1,2,3)
x,y,z = t #Now: x=1, y=2, z=3

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Norman, Oklahoma, United States
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to