I have a code to draw a real-time scatter plot using matplotlib based on references. How do i get a real-time line graph instead?
import time
import matplotlib.pyplot as plt
plt.axis([0, 100, -10, 10])
plt.ion()
plt.show()
ts_start = time.time()
## perpetual loop code
p_x = int(int(time.time())-int(ts_start))
p_y = mynum # keeps getting generated in the loop code
plt.scatter(p_x, p_y)
plt.plot(p_x, p_y)
plt.draw()
time.sleep(0.05)