I have variables x
and y
def function(a,b):
x = x[(x>a)*(xb)]
# perform some fitting
The key is using the three parameter form of subplot:
import matplotlib.pyplot as plt
# Build a list of pairs for a, b
ab = zip(range(6), range(6))
#iterate through them
for i, (a, b) in enumerate(ab):
plt.subplot(2, 3, i+1)
#function(a, b)
plt.plot(a, b)
plt.show()
You'll just have to take the call to figure
out of the function.