Spatial Map with Cartopy#
This section demonstrates how to plot spatial correlation maps using Cartopy.
import cartopy.crs as ccrs
import cartopy.feature as cfeature
ax = plt.axes(projection=ccrs.LambertConformal())
ax.set_extent([-125, -70, 25, 50])
ax.add_feature(cfeature.COASTLINE)
ax.add_feature(cfeature.STATES)
im = ax.pcolormesh(lon, lat, data, transform=ccrs.PlateCarree(), cmap="coolwarm")
plt.colorbar(im, orientation="horizontal", pad=0.05)
plt.title("Spatial Pattern")
plt.show()