Re: [Matplotlib-users] New aspect function for pylab

2007-03-02 Thread Eric Firing
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

Re: [Matplotlib-users] New aspect function for pylab

2007-03-02 Thread Christopher Barker
John Hunter wrote: > On 2/27/07, Christopher Barker <[EMAIL PROTECTED]> wrote: >> There is nothing inherent in OO >> design that makes it necessary to write a bunch more code. > > I don't agree with this at all. Inherent in OO design is object > creation, attribute setting and method calling.

Re: [Matplotlib-users] New aspect function for pylab

2007-02-27 Thread John Hunter
On 2/27/07, Christopher Barker <[EMAIL PROTECTED]> wrote: > Or even more - not use pylab at all. There is nothing inherent in OO > design that makes it necessary to write a bunch more code. It would be > nice if the OO interface were just as easy to use. I don't agree with this at all. Inherent

Re: [Matplotlib-users] New aspect function for pylab

2007-02-27 Thread Christopher Barker
Eric Firing wrote: > make it as easy as possible for a person to do > something interactive in pylab and then translate it into a more > OO-style script. Or even more - not use pylab at all. There is nothing inherent in OO design that makes it necessary to write a bunch more code. It would be ni

Re: [Matplotlib-users] New aspect function for pylab

2007-02-27 Thread Eric Firing
Mark Bakker wrote: > John - > > Maybe I misunderstand you, but I thought the pylab interface > was invented to do very useful stuff (yet you want to prevent it > from doing something useful ??). No, the point is to minimize differences between pylab functions and object methods, to make it as eas

Re: [Matplotlib-users] New aspect function for pylab

2007-02-27 Thread Mark Bakker
John - Maybe I misunderstand you, but I thought the pylab interface was invented to do very useful stuff (yet you want to prevent it from doing something useful ??). All the functionality is already in the API, but the calling sequence is too lengthy and somewhat convoluted for interactive use.

Re: [Matplotlib-users] New aspect function for pylab

2007-02-27 Thread John Hunter
On 2/27/07, Mark Bakker <[EMAIL PROTECTED]> wrote: > Thanks for the explanation, John. > I printed out the CODING_GUIDE (sorry, didn't know it existed). > The new function with the extra copy command is shown below. > Can we add this to pylab? Since Eric has been developing and maintaining the asp

Re: [Matplotlib-users] New aspect function for pylab

2007-02-27 Thread Mark Bakker
Thanks for the explanation, John. I printed out the CODING_GUIDE (sorry, didn't know it existed). The new function with the extra copy command is shown below. Can we add this to pylab? Thanks, Mark def aspect(*args, **kwargs): """ Set/Get the aspect ratio (ylength/xlength) of the current ax

Re: [Matplotlib-users] New aspect function for pylab

2007-02-26 Thread John Hunter
On 2/26/07, Mark Bakker <[EMAIL PROTECTED]> wrote: > ax = gca() > if len(args)==0: > aspect = ax.get_aspect() > elif len(args)==1: > aspect = args[0] > adjustable = popd(kwargs,'adjustable','box') > anchor = popd(kwargs,'anchor','C') > fixlim = popd(kwargs,'

[Matplotlib-users] New aspect function for pylab

2007-02-26 Thread Mark Bakker
Eric, list - Here is the new aspect function for possible inclusion in pylab. It works great and with the default values for the kwargs, it works exactly the way I think it is useful for a combination of contouring and plotting. What do you think, should we include this? Mark def aspect(*args,