I need to create a bunch of graphs based on a lot of previous code. I cant "hardcode" the axes variables because the spacing would be all wrong.
I have an arbitrary amount of axes that each need formatting as part of the whole, so I cannot create them individually.
What I have so far: I read How do you create different variable names while in a loop? , but as with half of all questions, it simply doesn't get answered, instead receiving some vaguely related code.
What I have:
ax1 = plt.subplot2grid((m, n), (j, k), colspan=1, rowspan=1)
ax3 = plt.subplot2grid((m, n), (j+1, k+1), colspan=1, rowspan=1)
ax4 = plt.subplot2grid((m, n), (j+2, k+2), colspan=1, rowspan=1)
ax5 = plt.subplot2grid((m, n), (j+3, k+3), colspan=1, rowspan=1)
ax1.plot(df['colA'], df['colB'])
etc
What I think I need
axcount = anyinteger
for i in np.arange(axcount):
ax & str(i+1) = plt.subplot2grid((m, n), (j + (i+1 - 1), k + (i+1 - 1)), colspan=1, rowspan=1)
ax & str(i+1) .plot(df['colA'], df['col' & chr(i+66)])
which is necessary because I will need to spec each axi's plot.
I am extremely new to this whole python thing, and from what Ive learned so far, it can do basically anything if you can find the syntax/function for it. Im hoping someone has the syntax/function that would allow me to solve my problem.