days = [1, 5, 10, 15, 20, 25]
dates = [f'{y}-{m:02}-{d:02}' for y in range(2014,2023) for m in range(1,13) for d in days][4:]
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December']
# Save a figure for each 30-day period, adding (30 / len(days)) days to each consecutive figure
for i in tqdm(range(len(dates) - len(days))):
### Test Cases:
# if dates[i] not in ['2016-07-01', '2016-07-15']:
# continue
fig, ax = plt.subplots(1, figsize=(10,10))
us49.boundary.plot(ax=ax)
fires = gdf[(gdf["FireDiscoveryDateTime"] > dates[i]) & (gdf["FireDiscoveryDateTime"] < dates[i+len(days)])]
fires = fires.cx[-124.7:-66.9, 24.5:49.4]
fires.plot(ax=ax, column="IncidentSize", cmap=my_cmap)
ax.set_title("Wildfire Incidents Reported (Monthly)",
y=1.0, fontsize=24)
ax.axis('off')
label_date = f"{months[int(dates[i][5:7])-1]} {dates[i][:4]}" # shows month AND year
# label_date = dates[i][:4]
ax.annotate(label_date,
xy=(0.335, 0.24), xycoords='figure fraction',
horizontalalignment='right', verticalalignment='top',
fontsize=24)
ax.annotate("Source: National Interagency Fire Center",
xy=(0.05, 0.20), xycoords='figure fraction',
horizontalalignment='left', verticalalignment='top',
fontsize=10)
ax.annotate("Christopher Abib (Team: I'll Figure It Out Later)",
xy=(0.95, 0.20), xycoords='figure fraction',
horizontalalignment='right', verticalalignment='top',
fontsize=10)
### Hard to read with the wiggling.
ax.annotate("This graphic visualizes the locations of each wildfire incident reported to the\nNational Interagency Fire Center on a monthly period from 2014 to 2022.",
xy=(0.05, 0.15), xycoords='figure fraction',
horizontalalignment='left', verticalalignment='top',
fontsize=16)
ax.legend(handles=[matplotlib.lines.Line2D([0], [0], marker='o', color='maroon', label='1 Incident Reported', alpha=0.5, linestyle='None')])
fig.subplots_adjust(top=1.4, bottom=-0.3, right=1.0, left=0, hspace=0, wspace=0)
fig.savefig(f"./maps/wildfire_incidents/{dates[i]}_fires.jpg", dpi=300)
plt.close()