【发布时间】:2019-04-04 00:42:44
【问题描述】:
我有一张想要投影到球体上的地图,我按照另一个线程中的建议使用 cartopy。我在 Jupyter 中编程。
我的代码是:
import os
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
os.chdir(os.getenv("HOME"))
os.chdir("Downloads/")
img = plt.imread("europamap1.jpg")
plt.figure(figsize=(3, 3))
ax = plt.axes(projection=ccrs.Orthographic(-10, 45))
ax.gridlines(color="black", linestyle="dotted")
ax.imshow(img, origin="upper", extent=(-180, 180, -90, 90),
transform=ccrs.PlateCarree()) # Important
plt.show()
我得到的是一个白色实心圆圈enter image description here
我不知道为什么我看不到任何网格线或图像!我试图 plot.show(img) 并加载了图像!我基本上只是从this thread复制粘贴过来的
【问题讨论】:
标签: python plot 3d visualization cartopy