I'm using the following code to make 2 plots,
import numpy as np
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]
x1 = [1, 2, 3, 4, 5]
y1 = [1, 4, 9, 14, 25]
t = np.arange(0.0, 2.0, 0.01)
s1 = np.sin(2*np.pi*t)
s2 = np.sin(4*np.pi*t)
plt.figure(1)
plt.subplot(111)
plt.plot(x, y)
plt.subplots(112)
plt.plot(x1, y1)
plt.figure(2)
plt.subplot(211)
plt.plot(t, s1)
plt.subplot(212)
plt.plot(t, 2*s1)
plt.show()
The first plot is fine but the second plot gets messed up,
But when I comment out the code for the 1st plot it plots as exected,