Re: [Matplotlib-users] Subclassing Figure and pylab.figure()

2006-06-21 Thread PGM
John > Well, we could keep it simple and just give a hook to custom figures. > If a user wants a custom subplot > > class MyFigure(Figure): >def add_my_subplot(self, *args, **kwargs): > self.axes.append(MySubplot(*args, **kwargs)) > > Is there any downside to this approach? It seems l

Re: [Matplotlib-users] Subclassing Figure and pylab.figure()

2006-06-21 Thread John Hunter
> "PGM" == PGM <[EMAIL PROTECTED]> writes: PGM> Now, till we (you ;)) are it, what about updating PGM> Figure.add_subplot() to call user-defined subplots ? I wrote PGM> something along the lines below for my own needs, but that PGM> might be a useful addition... Well, we coul

Re: [Matplotlib-users] Subclassing Figure and pylab.figure()

2006-06-21 Thread PGM
John > I modified pylab (and every backend, damn there are a lot) to support > this feature. Wow, impressive ! Thx a lot > Now you can pass a FigureClass kwarg to the pylab > figure function. With minimal extra work, we could support defaults > so you don't have to explicitly pass it. But b

Re: [Matplotlib-users] Subclassing Figure and pylab.figure()

2006-06-21 Thread John Hunter
> "Pierre" == Pierre GM <[EMAIL PROTECTED]> writes: Pierre> John, Thx for your answer. IMHO, the problem lies really Pierre> with Figure, not Canvas. I'd need the Canvas, whatever Pierre> backend defines it, recognizes that the figure is not a Pierre> classical 'Figure' , but

Re: [Matplotlib-users] Subclassing Figure and pylab.figure()

2006-06-20 Thread Pierre GM
On Tuesday 20 June 2006 11:37, John Hunter wrote: > > "Pierre" == Pierre GM <[EMAIL PROTECTED]> writes: > > Pierre> Folks, > Pierre> I have a tailor-made subclass of Figure (say, MyFigure) that I'd > Pierre> like to use interactively. Ideally, I'd like to have > Pierre> pylab.fi

Re: [Matplotlib-users] Subclassing Figure and pylab.figure()

2006-06-20 Thread John Hunter
> "Pierre" == Pierre GM <[EMAIL PROTECTED]> writes: Pierre> That seems to give me what I want, as long as I use the Pierre> GTKAgg backend. What should I do to have the same result Pierre> with another backend, without having to rewrite a Pierre> new_figure_manager each time ?

[Matplotlib-users] Subclassing Figure and pylab.figure()

2006-06-20 Thread Pierre GM
Folks, I have a tailor-made subclass of Figure (say, MyFigure) that I'd like to use interactively. Ideally, I'd like to have pylab.figure() (or an equivalent) create a MyFigure instance, instead of Figure. I wrote a myfigure() function based on pylab.figure(), substituting the - figManager =