Skip to content

Instantly share code, notes, and snippets.

@santiagocasas
Last active March 16, 2020 23:35
Show Gist options
  • Save santiagocasas/35a7ab45d0add38044eca9d79dfd6cfd to your computer and use it in GitHub Desktop.
Save santiagocasas/35a7ab45d0add38044eca9d79dfd6cfd to your computer and use it in GitHub Desktop.
plotdates
#getting the saved asymptote
flatasymp = max([c_pars[(country,chosen_plotmodel,'c_time')] for country in countries_list])+1
#finding the minimum date, namely date of first case among chosen countries
mindate = min([df_dict[country].index[0] for country in countries_list])
#creating a date range for the plot for each country
pred_date = pd.date_range(start=df_dict[country].index[0], periods=flatasymp).values
# using the mindate - 3days and the last predicted date + 3days for the x-limits of the plot
ax.set_xlim([mindate-np.timedelta64(3,'D'), pred_date[-1]+np.timedelta64(3,'D')])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment