I'm plotting on two figures and each of these figures have multiple subplots. I need to do this inside a single loop. Here is what I do when I have only one figure:
fig, ax = plt.subplots(nrows=6,ncols=6,figsize=(20, 20))
fig.subplots_adjust(hspace=.5,wspace=0.4)
plt.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)
for x in range(1,32):
plt.subplot(6,6,x)
plt.title('day='+str(x))
plt.scatter(x1,y1)
plt.scatter(x2,y2)
plt.colorbar().set_label('Distance from ocean',rotation=270)
plt.savefig('Plots/everyday_D color.png')
plt.close()
Now I know when you have multiple figures you need to do something like this:
fig1, ax1 = plt.subplots()
fig2, ax2 = plt.subplots()
But I don't know how to plot in the loop, that each subplot is in it's place (Because you can't keep doing plt.scatter if there are two figures). Please be specific with what do I need to do (regarding whether it is fig1.scatter, ax1.scatter, fig.subplots_adjust, ... and how to save and close at the end)