import matplotlib.pyplot as plt
from matplotlib.patches import PathPatch
import cartopy.crs as ccrs
from cartopy.examples.waves import sample_data
plt.figure(figsize=(10, 10))
ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines()
plate_carre_data_transform = ccrs.PlateCarree()._as_mpl_transform(ax)
lons, lats, data = sample_data()
quad_set = plt.contourf(lons, lats, data, transform=ccrs.PlateCarree())
for collection in quad_set.collections:
collection.set_clip_path(us_path, plate_carre_data_transform)
# Draw the path of interest.
ax.add_patch(PathPatch(us_path, transform=ccrs.PlateCarree(), facecolor='none',
edgecolor='gray', linewidth=5, alpha=0.5))
plt.show()