【发布时间】:2019-11-07 17:31:55
【问题描述】:
我正在尝试通过 cartopy 将一些数据放到等高线图上。但是,在绘制数据之后,投影似乎仍然关闭。 surface_temp.X 和 surface_temp.Y 是纬度/经度,而 masked_fill 是实际数据值。这似乎在底图中有效,但我不确定为什么它在 cartopy 中无效。
卡托比:
fig = plt.figure(figsize=(12,4.76), dpi=100)
fig.clf()
ax = plt.axes(projection=ccrs.Mercator())
ax.coastlines()
ax.contourf(surface_temp.X, surface_temp.Y, surface_temp.masked_fill[:], latlon = 'true', transform = ccrs.Mercator())
plt.show()
底图:
fig = plt.figure(figsize=(15,4.76), dpi=100)
fig.clf()
plt.axes([0,0,1,1], frameon=False)
plt.title(title)
m = Basemap(projection='merc',llcrnrlat=-80,urcrnrlat=80, llcrnrlon=0,urcrnrlon=360,lat_ts=20,resolution='c')
m.contourf(surface_temp.X, surface_temp.Y, surface_temp.masked_fill[:], latlon = 'true')
底图结果:
Cartopy 结果(轮廓注释掉):
Cartopoy 结果(轮廓)
【问题讨论】:
标签: python matplotlib matplotlib-basemap cartopy