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:

lines = ax.plot(t, y1, lw=2, color='red', label='1 hz')
line = lines[0]

Cheers,
Mike

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


------------------------------------------------------------------------------
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