Is this what you want?
import matplotlib.pyplot as plt
import numpy as np
if __name__ == "__main__":
fig, ax = plt.subplots(1, 1)
theta = np.linspace(0, 2*np.pi, 1024)
ln, = ax.plot(theta, np.sin(theta))
plt.ion()
plt.show(block=False)
while True:
w = raw_input("enter omega: ")
try:
w = float(w)
except ValueError:
print "you did not enter a valid float, try again"
continue
y = np.sin(w * theta)
ln.set_ydata(y)
plt.draw()
I think I was sending you down a much too complicated path in the comments