在 Cartopy 中查看北极的阿拉斯加/东西伯利亚一侧

问题描述

我使用以下代码cartopynorthPolarstero 地图上绘制了一些点

fig,ax = plt.subplots(1,1,figsize=(8,8),subplot_kw={'projection': ccrs.northPolarstereo()})

ax.scatter([x[0] for x in max_coords[:-1]],[x[1] for x in max_coords[:-1]],color='k',s=50,marker='x',transform=ccrs.PlateCarree(),zorder=5,label='BSH Center 1980-2020')

ax.set_extent([-180,180,90,66],ccrs.PlateCarree())

ax.add_feature(cartopy.feature.LAND,edgecolor='black',zorder=1)

ax.legend(fontsize='x-large')

enter image description here

但我实际上只想绘制此图像的上半部分,如下所示:

enter image description here

如果我将 ```ax.set_extent`` 行更改为:

[90,-90,66] 要么 [-90,66]

它只是给了我情节的下半部分,就像这样:

enter image description here

有人知道如何获得上半部分吗?我还尝试将 northPolarstereo 线的 central_longitude 关键字设置为 +/- 180,但它只是显示错误的一半颠倒了。

解决方法

要设置绘制所需区域的范围,您应该使用正在使用的投影坐标 ccrs.NorthPolarStereo()。您需要的相关代码是:-

ax.set_extent([-2.633e+06,2.696e+06,-6e+04,2.9e+06],crs=ccrs.NorthPolarStereo()) 

你应该得到类似这样的情节:

nps_top

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...