开发者

Access to the coordinates of a 3D graphic inserted in a Tkinter.canvas

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜