I am trying to plot some data from a camera in real time using OpenCV. However, the real-time plotting (using matplotlib) doesn\'t seem to be working.
I\'ve isolated
Here's the working version of the code in question (requires at least version Matplotlib 1.1.0 from 2011-11-14):
import numpy as np
import matplotlib.pyplot as plt
plt.axis([0, 10, 0, 1])
for i in range(10):
y = np.random.random()
plt.scatter(i, y)
plt.pause(0.05)
plt.show()
Note some of the changes:
plt.pause(0.05)
to both draw the new data and it runs the GUI's event loop (allowing for mouse interaction).