I want to have two plots (#1, #2). I want to update the plot #1 as data is coming up, and then update plot #2 as well. After this, I might want to go back and update plot #1. However, I am unable to update plot #1. Any help?
Here are my source code.
import matplotlib.pyplot as plt
import numpy as np
a = np.random.random(10)
b = np.random.random(10)
plt.subplot(311)
for i in range (10):
y = a[i]
x = b[i]
plt.scatter(x,y)
plt.pause(0.05)
plt.subplot(312)
for i in range (10):
x = a[i]
y = b[i]
plt.scatter(x,y)
plt.pause(0.05)
# update plot #1, but this doesn't work
aa = np.random.random(20)
bb = np.random.random(20)
plt.subplot(311)
for i in range (20):
y = aa[i]
x = bb[i]
plt.scatter(x,y)
plt.show()