tooltips in matplotlib?

mpl.use('WXAgg') has to come before "import pylab"

Right, my mistake. My mpl defaults to wxagg, so I didn't notice that.
I'll post an updated one to the devel list.

once running, it's not working quite right: the tooltip always is at the bottom of the Window, though it does track the X location.

Hm, dunno. I'm running win32 (winxp), Python 2.4.3.

wx.__version__

'2.6.3.3'

matplotlib.__version__

'0.87.5'

Maybe try updating your wx install.

oddly it looks likeit's getting it's coords in figure units (0 to 1), whcih shouldn't work with a wxWindow.

That's as expected. It's using MPL's event.xdata and event.ydata
attributes, which are in data coords. If you want pixel coordinates, you
can use event.x and event.y (I think).

Martin

once running, it's not working quite right: the tooltip always is at the bottom of the Window, though it does track the X location.

Hm, dunno. I'm running win32 (winxp), Python 2.4.3.

Maybe try updating your wx install.

I've tried with 2.6.3, same result.

I think this is a platform issue: I expect that GTK is putting the tooltip at the bottom of the wx.Window it's on. this is really to bad, as with larger Windows, that might not be what you want.

In fact, I have a need to add tooltips to a wx.lib.floatcanvas based app, a I need to be able to place them where I need. I guess I'll send a note to wxpython-users about this.

I've enclosed a wxpython tiny test app, to isolate matplotlib issues. It has the same behavior. does the tooltip follow the mouse on Windows (or OS-X)

-Chris

ToolTips.py (1.4 KB)

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Just gave it a try, and yes, the tooltip tracks the mouse perfectly for me on my win32 install.

Martin

Christopher Barker wrote:

···

once running, it's not working quite right: the tooltip always is at the bottom of the Window, though it does track the X location.

Hm, dunno. I'm running win32 (winxp), Python 2.4.3.

Maybe try updating your wx install.

I've tried with 2.6.3, same result.

I think this is a platform issue: I expect that GTK is putting the tooltip at the bottom of the wx.Window it's on. this is really to bad, as with larger Windows, that might not be what you want.

In fact, I have a need to add tooltips to a wx.lib.floatcanvas based app, a I need to be able to place them where I need. I guess I'll send a note to wxpython-users about this.

I've enclosed a wxpython tiny test app, to isolate matplotlib issues. It has the same behavior. does the tooltip follow the mouse on Windows (or OS-X)

-Chris