使用经度和纬度限制区域的 AlbersEqualArea。

3

我有一些数据,其经度范围为-100o至30o,纬度范围为0o至80o。

我想使用一个投影来仅显示这个区域。

在我的脑海中,我想展示一个像这样的图:

regional map

然而,当我尝试使用AlbersEqualArea投影如下:

plt.figure(figsize=(5.12985642927, 3))
ax = plt.axes(projection=ccrs.AlbersEqualArea(central_longitude=-35, central_latitude=40, standard_parallels=(0, 80)))    
ax.set_extent([lon180[0], lon180[-1], lat[0], lat[-1]], ccrs.Geodetic())

我得到了一张显示:

regional AEA map

我该如何显示我拥有数据的区域?

2个回答

9
如果你想要一个非矩形的边界,你需要自己定义。以下示例可能适合你:
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
import matplotlib.path as mpath

proj = ccrs.AlbersEqualArea(central_longitude=-35,
                            central_latitude=40,
                            standard_parallels=(0, 80))
ax = plt.axes(projection=proj)    
ax.set_extent([-100, 30, 0, 80], crs=ccrs.PlateCarree())
ax.coastlines()

# Make a boundary path in PlateCarree projection, I choose to start in
# the bottom left and go round anticlockwise, creating a boundary point
# every 1 degree so that the result is smooth:
vertices = [(lon, 0) for lon in range(-100, 31, 1)] + \
           [(lon, 80) for lon in range(30, -101, -1)]
boundary = mpath.Path(vertices)
ax.set_boundary(boundary, transform=ccrs.PlateCarree())

plt.show()

enter image description here


感谢您教我关于边界的知识。使用网格线添加经度和纬度到图表中似乎不可行。我在使用PlateCarree(PC)和AlbersEqualArea(AEA)之间犹豫不决。我正在研究北大西洋的季节性预测,AEA更加注重热带地区,而这里的季节性预测效果很好。然而,我正在研究NAO,PC可能更能突出该地区。使用AxesGrid,PC看起来更好,经纬度刻度是一个优势。 PC地图:http://imgur.com/a/GcWFr AEA地图:http://imgur.com/a/Uxl1n 您有偏好吗? - Ray Bell
在类似这样的边界裁剪地图上添加刻度标签是否可行? - Denis Sergeev

-1

我认为你可能需要在绘图中添加AlbersEqualArea作为变换,可能更像this


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接