Here's the graphing portion of my program:
https://ibb.co/z7021yD
What have I done?
Incidentally, if I comment out L5, the blue line goes away and the orange line/markers get compressed on the left side of the graph. This make some sense because len(trade_list) is 255 and len(btstats['SPX']) is 3449. I just want the 255 points to print accordingly where their x-values match up with those on the x-axis.
fig, axs = plt.subplots(1,1) fig.set_size_inches(14, 6) axs.plot(trade_list,P_price_orig_all, marker='o', color='orange') ax1twin = axs.twinx() ax1twin.plot(btstats['Date'],btstats['SPX'],marker='',color='blue',linestyle='solid') #May still have to include y-axis label. axs.set_xticks(list(np.linspace(1,len(btstats.index),num=len(xtick_labels_converted))),xtick_labels_converted, rotation=45) plt.show()I spend all those hours figuring out L7 to get evenly spaced (in time) dates to print out evenly spaced across the x-axis. However, trade_list (a list of dates) is not evenly spaced in time. These points print out evenly spaced--not in reference to the date values now shown on the x-axis:
https://ibb.co/z7021yD
What have I done?
Incidentally, if I comment out L5, the blue line goes away and the orange line/markers get compressed on the left side of the graph. This make some sense because len(trade_list) is 255 and len(btstats['SPX']) is 3449. I just want the 255 points to print accordingly where their x-values match up with those on the x-axis.