update a matplotlib figure from another class <p>How can I update a matplotlib figure that is a child of a frame in another class in tkinter? Here is where I am stuck.</p> <pre><code>class A(): def__init__(self, master): sframe = Frame(master) sframe.pack(side=RIGHT) f = Figure(figsize=(3,2), dpi=100) a = f.add_subplot(122); # initially plots a sine wave t = arange(0.0, 1, 0.01); s = sin(2*pi*t); a.plot(t,s); canvas = FigureCanvasTkAgg(f, master=sframe) canvas.show() canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1) # now i create the other object that will call show() data_obj = B(sframe) class B(): ... show(self, frame): _wlist = frame.winfo_children() for item in _wlist: item.clear() # or something like this # and then re-plot something or update the current plot </code></pre>