[Matplotlib-users] Selectable vertical lines

2014-01-07 Thread V. Armando Solé
Hello, I am trying to add some vertical lines into a matplotlib figure axes. The idea is to detect when the mouse passes over those lines in order to displace them following the mouse if the left button is pressed. I need some help to know the simplest way to proceed. Currently I am looking

[Matplotlib-users] Interative legend manipulation?

2014-01-07 Thread Skip Montanaro
Sometimes the legend simply gets in the way. You can't always guess the correct placement (think generic tool which processes lots of different input data sets), or zooming/panning makes it obscure a chunk of the plot you want to look at. Is it possible to move it interactively? I'm using mpl

Re: [Matplotlib-users] Selectable vertical lines

2014-01-07 Thread Fabrice Silva
Le mardi 07 janvier 2014 à 15:19 +0100, V. Armando Solé a écrit : Hello, I am trying to add some vertical lines into a matplotlib figure axes. The idea is to detect when the mouse passes over those lines in order to displace them following the mouse if the left button is pressed. I

Re: [Matplotlib-users] Interative legend manipulation?

2014-01-07 Thread Paul Hobson
I believe (as of v1.3.1) that after you create the legend you call leg.draggable(True) http://matplotlib.org/api/legend_api.html#matplotlib.legend.Legend.draggable On Tue, Jan 7, 2014 at 6:37 AM, Skip Montanaro s...@pobox.com wrote: Sometimes the legend simply gets in the way. You can't

Re: [Matplotlib-users] Selectable vertical lines

2014-01-07 Thread V. Armando Sole
On 07.01.2014 16:27, Fabrice Silva wrote: Le mardi 07 janvier 2014 à 15:19 +0100, V. Armando Solé a écrit : Hello, I am trying to add some vertical lines into a matplotlib figure axes. The idea is to detect when the mouse passes over those lines in order to displace them following the

Re: [Matplotlib-users] Interative legend manipulation?

2014-01-07 Thread Skip Montanaro
I believe (as of v1.3.1) that after you create the legend you call leg.draggable(True) http://matplotlib.org/api/legend_api.html#matplotlib.legend.Legend.draggable Outstanding! (Google was not my friend here. I wasn't searching for draggable.) Skip

Re: [Matplotlib-users] Selectable vertical lines

2014-01-07 Thread Fabrice Silva
Le mardi 07 janvier 2014 à 17:57 +0100, V. Armando Sole a écrit : What about using axvline with the picker argument? see http://matplotlib.org/users/event_handling.html I think axvline is part of the pyplot interface that I am not using. However your link is going to help me a lot. I

Re: [Matplotlib-users] Selectable vertical lines

2014-01-07 Thread V. Armando Sole
On 07.01.2014 18:18, Fabrice Silva wrote: Le mardi 07 janvier 2014 à 17:57 +0100, V. Armando Sole a écrit : What about using axvline with the picker argument? see http://matplotlib.org/users/event_handling.html I think axvline is part of the pyplot interface that I am not using.

[Matplotlib-users] Most generic way to wrap collections

2014-01-07 Thread Adam Hughes
Hi, I am working on a library for image analysis which stores particles as indexed numpy arrays and provides functionality for managing the particles beyond merely image masking or altering the arrays directly. I've already designed classes for many common shapes including Lines/Curves,

Re: [Matplotlib-users] Most generic way to wrap collections

2014-01-07 Thread Adam Hughes
Sorry, quick followup. I did find the gallery example to plot multiple patches together: http://matplotlib.org/examples/api/patch_collection.html That's excellent. Now I guess my question is how best to generalize the process of turning my objects into patches. I think I will just try to keep

Re: [Matplotlib-users] Most generic way to wrap collections

2014-01-07 Thread Paul Hobson
Adam, Not sure if this is the try you're trying to bark up, but I've used a total hack to do what I think you're describing: 1) store lists of coordinate pairs in a pandas DataFrame 2) use df.apply() to turn each list of coords in to a patch and add to an axes object I'm sure you know this,

Re: [Matplotlib-users] Most generic way to wrap collections

2014-01-07 Thread Joe Kington
On Tue, Jan 7, 2014 at 2:29 PM, Adam Hughes hughesada...@gmail.com wrote: Sorry, quick followup. I did find the gallery example to plot multiple patches together: http://matplotlib.org/examples/api/patch_collection.html That's excellent. Now I guess my question is how best to generalize

Re: [Matplotlib-users] Most generic way to wrap collections

2014-01-07 Thread Adam Hughes
Sorry, had forgot to reply all: Thanks Joe, that's perfect. I appreciate the tip, as I would not have realized I needed a PathCollection for lines and curves. PS, do you know if it is possible to have a background image behind a plot of patches? I know it's doable for scatter, but hadn't seen