Skip to content Skip to sidebar Skip to footer

Draw Now And Matplotlib

I am currently working on a project that involves taking analog readings, and mapping them real time on a graph. So to complete this I am running a photo resister through an Arduin

Solution 1:

Something like:

fig, ax = plt.subplots()
ln, = ax.plot([], [], 'go-')
while True:
    x, y = get_new_data()
    X, Y = ln.get_xdata(), ln.get_ydata()
    ln.set_data(np.r_[X, x], np.r_[Y, y])
    fig.canvas.draw()
    fig.canvas.flush_events()

should do the trick.

Post a Comment for "Draw Now And Matplotlib"