如何使用 PyPlot 消除鼠标悬停坐标?
Hej,我对编程还很陌生。我需要将一些 PyPlot 图形包含到 Tkinter GUI 上(使用 Python 2.6)。到目前为止一切顺利,工作顺利,唯一烦人的是工具栏中自动应用了鼠标悬停效果,这会产生鼠标位置的精确坐标。我怎样才能抑制这个功能?我只找到了有关如何格式化该输出的食谱,但我想完全摆脱它。
非常感谢!
Hej, I'm fairly new to programming. I need to include some PyPlot Figures onto a Tkinter GUI (using Python 2.6). So far so good, made that work, the only annoying thing is that a mouse over effect is automatically applied in the toolbar, which yields exact coordinates of the mouse position. How can I suppress that function? I only found cookbooks on how to format that output, but I want to completely get rid of it.
Thanks a bunch!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过将
'break'
从侦听器传递到应用程序?更多详细信息请参见此处。
Have you tried passing
'break'
to the application from the listener?More details here.
我最终为将来遇到类似问题的任何人找到了解决方案:您需要编辑 matplotlib 的 backend_bases 模块中的函数:mouse_move。这部分负责:
if event.inaxes and event.inaxes.get_navigate():
如果你想完全摆脱坐标,只需擦除或注释它。也可能会影响那里的格式,但没有尝试。
雅各布
I eventually found the solution for anyone that faces similar problems in the future: you need to edit the function: mouse_move in the module backend_bases of matplotlib. This part is responsible:
if event.inaxes and event.inaxes.get_navigate():
Just erase or comment it if you want to get rid of the coordinates completely. Might be possible to influence the format there too, didn't try that.
Jakob