Thanks in advance for the help!
I have a for loop in which I am iterating through multiple datasets and conducting an analysis. I'd like to have all of those data sets and graphs to show up on 1 window.
However, when I run the following code, I get 5 figures (located correctly from a subplot perspective) and 5 separate windows. I'd like for the 5 figures to be in 1 window and cannot seem to figure this one out.
data_list = {'close': close_data, 'volume': volume_data, 'high': high_data, 'low': low_data, 'open': open_data}
for key, value in data_list.items():
tt = datetime
yy = value
y_data_ma = uniform_filter1d(value, size=ma_window)
res = fit_sin(tt, yy)
x_label = "time"
y_label = key
graph_name = "{symbol}".format(symbol=symbol) + " " + str(legend_name) + " data - time vs " + y_label
num = int(list(data_list.keys()).index(key) + 1)
print(num)
plt.figure()
plt.subplot(3,2,num)
#ax.figure("{symbol}".format(symbol=symbol) + " " + 'time' +" vs " + y_label)
plt.title(graph_name, fontsize="8")
plt.xlabel("{}".format(x_label))
plt.ylabel("{}".format(str(y_label)))
plt.plot(datetime, yy, 'r.', ms=1, label = graph_name)
plt.plot(datetime, y_data_ma, label = str(ma_window) + ' day moving average')
plt.plot(datetime, res["fitfunc"](datetime), "r-", label="y fit curve = " + str(res["equation"]), linewidth=2)
plt.tick_params(axis='both',which='major',labelsize=10)
plt.legend(loc='best')
plt.tight_layout()
plt.show()