I am a new matplotlib user building a simple visualization tool.
I was having some issues with the graph not redrawing and I think I have reduced it to a minimal case that doesn’t work as expected for me.
In the example below one of the data elements is changed on every iteration of the update function, but the graph does not update as expected.
Am I making a mistake in my usage?
from matplotlib.figure import Figure
import numpy as np
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
win = gtk.Window()
win.connect(“destroy”, lambda x: x.destroy())
fig = Figure(figsize=(5,4), dpi=100)
ax = fig.add_subplot(111)
canvas = FigureCanvas(fig)
data = np.random.randn(100)
line, = ax.plot(data)