I suggest you use only one plt.show() at the end of all plotting commands. So your code should look like this:
import matplotlib.pyplot as plt plt.plot([1,2,3,4,5]) plt.plot([2,2,2,2,2]) plt.show()