【发布时间】:2021-08-16 05:12:54
【问题描述】:
我正在尝试绘制全球风暴轨迹,但是当风暴越过日期变更线(并且经度从 ~360 到 ~0)时,这条线会一直绕着绘图空间循环。 Here's what the plot looks like. See the weird straight lines near the top. 这是我的代码:
ax = plt.axes(projection=ccrs.Robinson())
ax.set_global()
ax.coastlines()
for i in range(nstorms-1): #loop through each TC
bidx = start_idx[i]
eidx = start_idx[i+1]
plt.plot(clons[bidx:eidx],clats[bidx:eidx],transform=ccrs.PlateCarree())
【问题讨论】:
-
嘿,Alyssa,您可以提供一个最小的可重现示例吗? IE。包括其中一个风暴的风暴轨迹数据证明了这个问题?
-
当然:ax = plt.axes(projection=ccrs.PlateCarree()) ax.set_global() ax.coastlines() lons = [347.87, 349.62, 352.4414, 358.06, 3.69, 7.20] lats = [32.33, 33.63, 34.8, 37.14, 39.25, 42.30] plt.plot(lons,lats,transform=ccrs.PlateCarree())
标签: python matplotlib cartopy