I want to shift the start position of the red line from "FEB-2020" to "JAN-2021". Currently this is my code and a picture of my current output. Basically Shorten the period of the whole graph to the dates stated above.
# plot daily vaccinated
fig, ax1= plt.subplots(1,figsize=(20,10))
# set up
plt.ticklabel_format(style='plain') #changing the tick figure from le 6 to millions
plt.setp(ax1, xticks= np.arange(0, 680, 30), xticklabels=vac_dates)
# plot chart
ax1.plot(vaccinated['received_at_least_one_dose'], label= 'Total Vaccinated', c='Red')
# axis and legend settings
ax1.set_ylabel('population (millions)', size= 14)
ax1.set_title('Monthly Vaccinated Numbers', size= 20)
plt.xticks(rotation=45)
plt.grid()
ax1.legend(loc="upper left")
##########################################################
# plot daily covid cases
ax2 = ax1.twinx()
# np.arrange looks at the number of rows
plt.setp(ax2, xticks= np.arange(0, 1035, 31), xticklabels=dates)
ax2.xaxis.tick_top()
ax2.plot(infected_update)
plt.xlabel('date', fontsize=14)
plt.ylabel('population (thousands)', fontsize=14)
plt.grid(False)
ax2.legend(['imported','local'], loc="upper right")
I've tried using codes from the following links but it doesn't seem to work
https://stackoverflow.com/questions/29370057/select-dataframe-rows-between-two-dates
https://stackoverflow.com/questions/32434607/how-to-shift-a-graph-along-the-x-axis