Christopher Barker wrote:
[...]
> It is nice to have a really simple plot command. What would it do if we 
> were trying to be fully OO? My key question is whether it would return 
> and axis, a figure or both:
> 
> Fig, ax = plot([1,2,3])
> 
> then:
> 
> ax.xlabel("whatever")
> 
> isn't bad for me.

Sometimes plot creates a figure, sometimes it creates an axes, sometimes 
neither, but it always creates one or more Line2D objects, so that is 
what it returns--a list of lines.  As far as I can see, it *has* to 
return this, or something containing this, so that one can work later 
with these most fundamental objects that it makes.  An alternative would 
be some sort of LineSet object like the ContourSet object returned by 
contour, with lots of extra information, but I don't know that there 
would be any advantage.

Anyway, the point is that your alternatives for plot to return would not 
work well in practice, but what it does return now works fine, both for 
plot() and for ax.plot().

Eric

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to