On 7 Oct 2011, at 4:56 PM, Daniel Hyams wrote:

> I'm wanting to highlight the artist under the cursor with a  
> transparent Rectangle patch.  To do this, I have very, roughly, in a  
> mouse motion handler,
>
> under = self.figure.hitlist(ev)
> if under:
>    artist = under[0]
>    bbox = artist.get_window_extent()
>    highlight =  
> matplotlib 
> .patches 
> .Rectangle 
> (xy 
> = 
> bbox.min,width=bbox.width,height=bbox.height,alpha=0.2,color='yellow')
>    # further code to blit the last captured graph region with  
> highlight drawn on top
>
> The main problem is that all artists don't implement  
> get_window_extent(); a Text object does, and a legend object does,  
> but the Axis objects do not.
>
> So is there a general way to get the bounding box of an artist?

Did you ever find a way to get the bounding box of an artist?  I could  
use this too.

Michael.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to