I did have a similar problem and found solution here on SO.I think that you need plt.ion().One example
import numpy as np
from matplotlib import pyplot as plt
def main():
plt.axis([-20,20,0,10000])
plt.ion()
plt.show()
x = np.arange(-20, 21)
for pow in range(1,5): # plot x^1, x^2, ..., x^4
y = [Xi**pow for Xi in x]
plt.plot(x, y)
plt.draw()
plt.pause(0.001)
input("Press [enter] to continue.")
if __name__ == '__main__':
main()
Works fine,although it gives this warning
MatplotlibDeprecationWarning: Using default event loop until function specific to this GUI is implemented
warnings.warn(str, mplDeprecation)
I am not sure if that is related to 3.6 version or not.