访问插入 Tkinter.canvas 中的 3D 图形的坐标
我对 matplotlib 很陌生,因此遇到了一些问题。我尝试在 Tkinter 画布中插入 3D 图形,我想获取(单击时)鼠标的位置。问题是 event.x 和 event.y 返回鼠标在画布“基础”中的位置。是否可以获取 3D 图形上的 (x,y,z) 坐标? 我看到这些坐标在工具栏中给出,是否有可能访问它们?
这是我使用的代码的一部分
fen1 = Tk.Tk()
fen1.wm_title("Calcul des desorientation entre grain")
fen1.bind("<Destroy>", destroy)
canvas = FigureCanvasTkAgg(fig, master=fen1)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
toolbar = NavigationToolbar2TkAgg(canvas,fen1)
toolbar.update()
canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
......
如果有人可以帮助我,我将不胜感激。
I am very new in matplotlib and consequently I encounter some problems.. I try to insert a 3D graphic in a Tkinter canvas and I would like to get, (on click), the position of the mouse. The problem is that event.x and event.y return the position of the mouse in the canvas "base". Is it possible to get the (x,y,z) coordinates on the 3D graphic?
I saw that these coordinates are given in the toolbar, is there any possibility to access them?
Here is a part of the code I used
fen1 = Tk.Tk()
fen1.wm_title("Calcul des desorientation entre grain")
fen1.bind("<Destroy>", destroy)
canvas = FigureCanvasTkAgg(fig, master=fen1)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
toolbar = NavigationToolbar2TkAgg(canvas,fen1)
toolbar.update()
canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
...
I would be grateful if someone can help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论