[Matplotlib-users] Fwd: Event handling

2009-01-27 Thread Nils Wagner
---BeginMessage---
Please respond on list and I, or someone else, will try and respond.

On Tue, Jan 27, 2009 at 7:08 AM, Nils Wagner
nwag...@iam.uni-stuttgart.de wrote:
 On Tue, 27 Jan 2009 06:37:09 -0600
  John Hunter jdh2...@gmail.com wrote:

 On Tue, Jan 27, 2009 at 2:15 AM, Nils Wagner
 nwag...@iam.uni-stuttgart.de wrote:

 Hi all,

 Is it possible to restrict the mouse movements to the points of a graph
 (curve tracking) ?


 No, but you can obtain the vertices of the line that are within a
 tolerance of the clicked point using the picking functions.  See the
 tutorial at

  http://matplotlib.sourceforge.net/users/event_handling.html

 and the pick* demos at

  http://matplotlib.sourceforge.net/examples/event_handling/index.html

 JDH

  Hi John,

 Thank you very much for your response.
 The horizontal distance between consecutive points is
 5. in my application.

 Is the value of picker linked to the distance ?
 I mean
 How should I use picker to circumvent multiple results ?

 Cheers,
   Nils


---End Message---
--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Fwd: Event handling

2009-01-27 Thread John Hunter
On Tue, Jan 27, 2009 at 8:18 AM, Nils Wagner
nwag...@iam.uni-stuttgart.de wrote:
 Thank you very much for your response.
 The horizontal distance between consecutive points is
 5. in my application.

 Is the value of picker linked to the distance ?
 I mean
 How should I use picker to circumvent multiple results ?

The scalar value of the picker is a epsilon tolerance in points (1
point = 1/72 inches) so you will need to set this distance to be small
enough to only overlap one point when you click.

If you want to only return a single point, you can write a custom
picker function to return only the point closest to the click point.

JDH

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Fwd: Event handling

2009-01-27 Thread Nils Wagner
On Tue, 27 Jan 2009 08:57:17 -0600
  John Hunter jdh2...@gmail.com wrote:
 On Tue, Jan 27, 2009 at 8:18 AM, Nils Wagner
 nwag...@iam.uni-stuttgart.de wrote:
 Thank you very much for your response.
 The horizontal distance between consecutive points is
 5. in my application.

 Is the value of picker linked to the distance ?
 I mean
 How should I use picker to circumvent multiple results ?
 
 The scalar value of the picker is a epsilon tolerance in 
points (1
 point = 1/72 inches) so you will need to set this 
distance to be small
 enough to only overlap one point when you click.
 
 If you want to only return a single point, you can write 
a custom
 picker function to return only the point closest to the 
click point.
 

Unfortunately, I am not sure how to implement a custom 
picker function.

Any pointer would be appreciated.

Thanks in advance.

Nils
  

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Fwd: Event handling

2009-01-27 Thread John Hunter
On Tue, Jan 27, 2009 at 9:27 AM, Nils Wagner
nwag...@iam.uni-stuttgart.de wrote:

 If you want to only return a single point, you can write
a custom
 picker function to return only the point closest to the
click point.


 Unfortunately, I am not sure how to implement a custom
 picker function.

 Any pointer would be appreciated.

The example I pointed you to in my first post has an example of a
custom picker function.  It is in the section labelled picking with a
custom hit test function

  http://matplotlib.sourceforge.net/examples/event_handling/pick_event_demo.html

We've taken a lot of time to write the documentation and examples.
When you ask us questions on the mailing list and we point you to
documentation and examples, please take the time to read them.  One
reason we wrote them is so that we would not have to continuously
solve the same problems over and over again on the mailing list.  I'm
happy to help if you find the documentation or examples confusing, but
it will serve us both if you spend some time trying to digest them.

JDH

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users