gui.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:monty 作者: shoeffner 项目源码 文件源码
def init_canvas(self):
        """Initializes the matplotlib canvas.

        Adapted from
        https://matplotlib.org/examples/user_interfaces/embedding_in_tk.html

        Generates a frame and palces a figure canvas and a navigation toolbar
        inside it.
        """
        frame_figure = tk.Frame(self.root, bd=1, relief=tk.SUNKEN)
        frame_figure.grid(row=0, column=0, sticky=tk.NW+tk.SW)
        canvas = FigureCanvasTkAgg(self.figure, master=frame_figure)
        canvas.show()
        canvas.get_tk_widget().pack()
        toolbar = NavigationToolbar2TkAgg(canvas, frame_figure)
        toolbar.update()
        canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号