[resend: apologies for the html mail].

I was trying to implement something where the user could change the
properties of an artist by right clicking on it...so I needed to find
out what artists are under the cursor at the time of the click.  It is
possible that the method that I'm using isn't the recommended one; if
not, I would appreciate any suggestions.

 I'm using fig.hitlist() to get the list of artists.  This function
works just fine with a regular xy plot, but if one (or both) of the
axes are in log scale, I get a NotImplementedError exception and
associated stack trace (run the attached demo code to see).  The
exception is being caused by line 249 in artists.py.

Now, if I modify artists.py slightly to swallow the exception, replacing

 for a in self.get_children():
      L.extend(a.hitlist(event))

 with

 try:
  for a in self.get_children():
      L.extend(a.hitlist(event))
 except:
   pass

 Then everything seems to work.  However, being unfamiliar with the
code, I'm not sure what else that might break, or how bad of an idea
swallowing the exception is here.

 I have attached a small demo code.  The error occurs in matplotlib
1.0.0 and matplotlib 1.0.1, on both Linux and Windows.


--
Daniel Hyams
dhy...@gmail.com

Attachment: hitlist_problem.py
Description: Binary data

------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT 
space for its ease of implementation, lower cost, and increased 
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to