In [1]:
import cartopy.io.shapereader as shpreader
from cartopy.mpl.patch import geos_to_path


shpfilename = shpreader.natural_earth(resolution='110m',
                                      category='cultural',
                                      name='admin_0_countries')
reader = shpreader.Reader(shpfilename)
countries = reader.records()
us_multipoly, = [country.geometry for country in countries
                 if country.attributes['name'] == 'United States']
main_us_geom = sorted(us_multipoly.geoms, key=lambda geom: geom.area)[-1]

us_path, = geos_to_path(main_us_geom)
In [2]:
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()
In [ ]: