I am trying to use Cartopy's proejction NearsidePerspective, but overlaping with the real Earth image provided by Matplotlib, and zooming in a bit by lowering the satellite_height
parameter. It appears that Cartopy is not able to trim the image properly for this specific type of setting. The image is displayed still oustide of what one would expect to be the map boundaries.
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(10,10))
# Set Projection
height=3000000
#height=35785831 # this is the default height
projection=ccrs.NearsidePerspective(central_longitude=120,
central_latitude=78,
satellite_height=height)
# Draw
ax = plt.axes(projection=projection)
ax.stock_img()
ax.coastlines(resolution='50m')
plt.show()
How can I combine Matplotlib's stock_img() and this configuration of NearsidePerspective to work properly? Or what would be an alternative way to get the result desired?
I am using Python 3.6 on Jupyter Notebook, Matplotlib 3.0.2, and Cartopy 0.16.0.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.