Hello,
first of all let me say: Matplotlib is really great. I'm used looking at
xplt-graphics and MPL is just beautifull!
For my programs I needed the coordinates of mouseclick and -release point so
I modified the HorizontalSpanSelector. With the class in the attached file
it is possible to use functions needing those coordinates.
In the example a large number of pionts is added to the plot so that you can
check out performance improvments when using blitting. This however is only
possible when calling
python LinseSelector.py -dGTKAgg
If using another backend blitting will not be possible right now (I don't
know ehy, I'm not very keen on this "manifold of backends" - I'm happy that
I got this running for GTKAgg and don't know why it is not working for
WXAgg).
If the position of the mousecklick and the actual position should be linked
by a straight line or a box (or none of both) can be set (e.g.
drawstyle='box').
Although this works fine for my belongings I'm still unhappy with two
things:
- All this doesn't look like the normal connect('event',function)-style. It
would be nicer if this LineSelector could also be handled in such a way.
- If one uses this LineSelector the callback-function has to accept exactly
two lenght-2 arays of floats (which means it is prescribed to the user). I'm
not quite sure if this is very practical.
Nice weekend,
Martin
LineSelector.py (8.03 KB)
···
--
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse f�r Mail, Message, More +++