On Tue, Oct 5, 2010 at 11:39 PM, Daniel Hyams <dhy...@gmail.com> wrote: > > I've run across a strange problem and perhaps I'm misusing something. I was > trying to set up picking so that I can interact with plotted objects, and I > get alot of error spew that looks like this: > > while checking <class 'matplotlib.lines.Line2D'> > Traceback (most recent call last): > File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 241, in > hitlist > hascursor,info = self.contains(event) > File "C:\Python26\lib\site-packages\matplotlib\lines.py", line 286, in > contains > path, affine = self._transformed_path.get_transformed_path_and_affine() > AttributeError: 'NoneType' object has no attribute > 'get_transformed_path_and_affine' > > This can be reproduced by the following code, even though there is no > picking involved...just mouse motion. Is there possibly a workaround for > this, or am I doing something wrong? > > import sys > from pylab import * > > ax = subplot(111) > ax.plot([0,1,2,3]) > > def on_move(event): > if event.inaxes: > lst = ax.hitlist(event) > print lst > > binding_id = connect('motion_notify_event', on_move) > > > show()
It looks like Line2D.contains() was relying on some attributes that were set by draw(). I'm not sure why those lines are not drawn (it looks like some axis line?), but contains() shouldn't cause a traceback regardless. I've fixed this in SVN. If you're not running SVN, the patch is small, but it should be noted that the error message you're seeing is purely cosmetic and shouldn't be causing any problems. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users