Python 3, Spyder 2.
When I run the following code I want the plot to appear when I enter a float 'a' + Enter. If I then enter a new 'a' I want the graph to update with the new 'a'. But Spyder is not showing the graph until I hit Enter only, which breaks the loop.. I have tried Inline and Automatic, same problem..
import matplotlib.pyplot as plt
L1 = [10.1, 11.2, 12.3, 13.4, 14.5, 13.4, 12.3, 11.1, 10.0]
done = False
while not done:
a = input("Please enter alpha (between 0 and 1), Enter to exit:")
if a == "":
done = True
else:
a = float(a)
L2 = [x * a for x in L1]
plt.plot(L1)
plt.plot(L2)