Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-29 Thread Gökhan Sever
One minor issue with the example is once you drag one of the items (legend or text or image) out of the plotting area there is no way to move them back unless you restart the example. Do you get the same defect? On Fri, Jan 29, 2010 at 11:40 AM, Jae-Joon Lee wrote: > I did some refactoring and

Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-29 Thread Jae-Joon Lee
added blitting support. -JJ On Fri, Jan 29, 2010 at 12:40 PM, Jae-Joon Lee wrote: > I did some refactoring and now the annotation is also draggable.. > I also added an example, > > examples/animation/draggable_legend.py > > Regards, > > -JJ > > > > On Fri, Jan 29, 2010 at 10:28 AM, John Hunter

Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-29 Thread Jae-Joon Lee
I did some refactoring and now the annotation is also draggable.. I also added an example, examples/animation/draggable_legend.py Regards, -JJ On Fri, Jan 29, 2010 at 10:28 AM, John Hunter wrote: > On Thu, Jan 28, 2010 at 10:14 PM, Fernando Perez wrote: >> On Thu, Jan 28, 2010 at 8:01 PM, C

Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-29 Thread John Hunter
On Thu, Jan 28, 2010 at 10:14 PM, Fernando Perez wrote: > On Thu, Jan 28, 2010 at 8:01 PM, Christopher Barker > wrote: >> Might I suggest that that be made: >> >> leg.draggable(True) >> leg.draggable(False) >> > > Agreed.  My favorite api for toggles is: > > _state = True OK, this is committed.

Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-29 Thread Michele Mattioni
Good job! +1 On Fri, Jan 29, 2010 at 4:14 AM, Fernando Perez wrote: > On Thu, Jan 28, 2010 at 8:01 PM, Christopher Barker > wrote: > > Might I suggest that that be made: > > > > leg.draggable(True) > > leg.draggable(False) > > > > Agreed. My favorite api for toggles is: > > _state = True > > d

Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-28 Thread Fernando Perez
On Thu, Jan 28, 2010 at 8:01 PM, Christopher Barker wrote: > Might I suggest that that be made: > > leg.draggable(True) > leg.draggable(False) > Agreed. My favorite api for toggles is: _state = True def toggle(state=None): global _state old = _state if state is None: _state

Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-28 Thread Christopher Barker
> On Thu, Jan 28, 2010 at 3:48 PM, John Hunter Cool -- nice example. I added the code to legend.py. Now you can do > > leg = ax.legend() > leg.draggable() > > to enable draggable mode. You can repeatedly call this func to toggle > the draggable state. Might I suggest that

Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-28 Thread Gökhan Sever
On Thu, Jan 28, 2010 at 3:48 PM, John Hunter wrote: > On Thu, Jan 28, 2010 at 3:02 PM, Adam Fraser > wrote: > > I thought I'd share a solution to the draggable legend problem since > > it took me forever to assimilate all the scattered knowledge on the > > mailing lists... > > Cool -- nice examp

Re: [Matplotlib-users] Draggable matplotlib legend

2010-01-28 Thread John Hunter
On Thu, Jan 28, 2010 at 3:02 PM, Adam Fraser wrote: > I thought I'd share a solution to the draggable legend problem since > it took me forever to assimilate all the scattered knowledge on the > mailing lists... Cool -- nice example. I added the code to legend.py. Now you can do leg = ax.legen

[Matplotlib-users] Draggable matplotlib legend

2010-01-28 Thread Adam Fraser
I thought I'd share a solution to the draggable legend problem since it took me forever to assimilate all the scattered knowledge on the mailing lists... class DraggableLegend: def __init__(self, legend): self.legend = legend self.gotLegend = False legend.figure.canvas.