# Initialize empty figure
fig, (ax1, ax2) = plt.subplots(1, 2, figsize = (12, 8))
# Add eaton census tracts and fire perimeter
ej_eaton.plot(
ax=ax1,
color='lightsteelblue',
edgecolor='midnightblue',
linewidth=0.4,
alpha=0.5,
label='Census Tracts'
)
eaton.plot(
ax=ax1,
color='red',
edgecolor='darkred',
linewidth= 0.4,
alpha=0.5,
label='Eaton Perimeter')
# Remove axis titles for left figure
ax1.axis('off')
# Add palisaides census tracts and fire perimeter
ej_palisades.plot(
ax=ax2,
color='lightsteelblue',
edgecolor='midnightblue',
linewidth=0.4,
alpha=0.5,
label='Census Tracts'
)
palisades.plot(
ax=ax2,
color='red',
edgecolor='darkred',
linewidth=0.4,
alpha=0.5,
label='Palisades Perimeter'
)
# Remove axis titles for right figure
ax2.axis('off')
# Add legends using Patch
legend_palisades = [Patch(facecolor='lightsteelblue', edgecolor='midnightblue', label='Palisades Census Tracts'), Patch(facecolor='red', edgecolor='darkred', label='Palisades Fire Perimeter')]
legend_eaton = [Patch(facecolor='lightsteelblue', edgecolor='midnightblue', label='Eaton Census Tracts'), Patch(facecolor='red', edgecolor='darkred', label='Eaton Fire Perimeter')]
ax1.legend(handles = legend_eaton, bbox_to_anchor=(0.7, 1.60))
ax2.legend(handles = legend_palisades, bbox_to_anchor=(0.6, 1.12))
# Add titles
fig.text(0.3, 0.82, 'Eaton', fontsize=16, ha='center')
fig.text(0.7, 0.82, 'Palisades', fontsize=16, ha='center')
fig.suptitle('Eaton and Palisades Fire with Census Tracts Overlaid', fontsize = 20)
plt.show()