No, I didn't... I believe that in this specific case, I just manually drew
a decently sized box around the axis spine and implemented my own contains
method to match.

It would be nice for every artist to be consistent in this area though.
Maybe a MEP is in order to make every artist have a consistent interface as
defined by the base class?
 On Dec 30, 2012 1:00 AM, "Michael McNeil Forbes" <
michael.forbes+pyt...@gmail.com> wrote:

> 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 SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to