立体投影引起了一些令人头疼的问题,并且可能是投影,它引起了纸盒多边形变换代码的大多数问题.
以下示例显示了如何使用cartopy生成极坐标立体图.
请注意:即使使用此代码,也可以调整示例数据分辨率,并发现绘图需要大约30分钟才能实际渲染(这是一个我们需要尽快排序的错误).
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from cartopy.examples.waves import sample_data
ax = plt.axes(projection=ccrs.NorthPolarStereo())
x, y, z = sample_data((100, 200))
cs = ax.contourf(x, y, z, 50,
transform=ccrs.PlateCarree(),
cmap='gist_ncar')
ax.coastlines()
# without the set_global, currently, the plot is tiny because the limits
# are being erroneously being set (opened issue for that)
ax.set_global()
plt.show()
注意:这个答案与cartopy v0.5.x有关(即在v0.5发布之前),这里提到的许多错误应该在将来的版本中被压缩.
希望有所帮助,