Displaying Matplotlib Navigation Toolbar in Tkinter via grid

前端 未结 3 1151
终归单人心
终归单人心 2020-12-11 00:22

I\'m developing a small Tkinter GUI to draw matplotlib-plots. (It contains a few Entries and assembles the plot according to their content.)

I have designed my plott

3条回答
  •  有刺的猬
    2020-12-11 00:59

    # the following works for me. I created an empty frame and display it using the grid
    # management system, so the frame will be able to use pack management system
    canvas = FigureCanvasTkAgg(fig, root)
    canvas.draw()
    canvas.get_tk_widget().grid(row=2, column=0)
    frame = Frame(root)
    frame.grid(row=0, column=1)
    toobar = NavigationToolbar2Tk(canvas, frame)
    canvas.get_tk_widget().grid(row=1, column=0)
    

提交回复
热议问题