我使用的Tkinter的FigureCanvasTkagg绘制一些数据matplotlib
。 我需要清除的身影,我绘制数据,并在按下按钮绘制新的数据。
这里是代码的一部分绘制(有之前定义的App类):
self.fig = figure()
self.ax = self.fig.add_subplot(111)
self.ax.set_ylim( min(y), max(y) )
self.line, = self.ax.semilogx(x, y, '.-') #tuple of a single element
self.canvas = FigureCanvasTkAgg(self.fig, master=master)
self.ax.semilogx(x, y, 'o-')
self.canvas.show()
self.canvas.get_tk_widget().pack(side='top', fill='both', expand=1)
self.frame.pack()
如何更新这样的画布的内容是什么?