fig = plt.figure(figsize=(15, 8))
ax = plt.axes(projection=ccrs.PlateCarree())
ax.set_global()
 
ax.set_facecolor("#1a1c1e")
ax.add_feature(cfeature.LAND, facecolor="#323539")
 
# 密度を描画。gridsizeで解像度を調整し、統計的なホットスポットを強調
hb = ax.hexbin(
    snapshot["Message.PositionReport.Longitude"],
    snapshot["Message.PositionReport.Latitude"],
    gridsize=120, mincnt=1, cmap="YlOrRd",
    edgecolors='#2c2e30', linewidths=0.4,
    transform=ccrs.PlateCarree()
)

plt.title(f"{target_time}")
plt.colorbar(hb, label="Vessel Counts")
plt.show()
 
fig.savefig("figure2.png", dpi=300, bbox_inches="tight")
plt.close(fig)
