So, I tried a mix of the code you posted above + stackoverflow code from your link. This is what I am trying:
time = mdates.drange(dt.datetime(2021, 3, 1, 0, 0, 0), dt.datetime(2021, 3, 3, 1, 0, 0), dt.timedelta(hours=6)) y = trainPredictPlot fig, ax = plt.subplots() ax.plot(time,y) start, end = ax.get_xlim() ax.xaxis.set_ticks(np.arange(start, end, 10)) ax.xaxis.set_major_formatter(ticker.FormatStrFormatter('%0.1f')) plt.show()The error I got a similar error:
Error:ValueError: x and y must have same first dimension, but have shapes (9,) and (15406, 1)
The problem starts at line 4. It does not run from line 4 and down...