'How can I change Lambert Conformal projection to Stereographic one using Cartopy in Python?

I have the proj string for a variable z in the Lambert Conformal projection (+proj=lcc +lat_0=40 +lon_0=-100 +lat_1=49 +lat_2=77 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +type=crs). When I plot it in the Lambert Conformal projection it seems ok: enter image description here

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import numpy as np

dx = dy = 12500
x = np.arange(-2137500, +2612500, +dx)
y = np.arange(+5400000, +1100000, -dy)

#### x.shape: 380, y.shape: 344, z.shape: 344*380

fig = plt.figure(figsize=(9, 9))
ax = plt.axes(projection=ccrs.LambertConformal())
ax.gridlines()
ax.add_feature(cfeature.LAND, facecolor='black')
kw= dict(central_longitude=-100, central_latitude=40.0, false_easting=0.0, false_northing=0.0, standard_parallels=(49,77))
cs = ax.pcolormesh(x, y, z, cmap='cividis', transform=ccrs.LambertConformal(**kw))

But when I plot it in Stereographic projection, it does not match! enter image description here

fig = plt.figure(figsize=(9, 9))
ax = plt.axes(projection=ccrs.NorthPolarStereo(central_longitude=0))
cs = ax.coastlines(resolution='110m', linewidth=0.5)
ax.gridlines()
ax.add_feature(cfeature.LAND, facecolor='black')
ax.set_extent([-120, 0, 50, 60], crs=ccrs.PlateCarree())
kw = dict(central_latitude=40, central_longitude=-100)
cs = ax.pcolormesh(x, y, z, cmap='cividis', transform=ccrs.Stereographic(**kw))


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source