我正在尝试使用 netcdf 绘制数据,Basemap
但我猜由于纬度指数是倒置的,所以我得到了一张倒置的地图。我应该如何解决这个问题?谢谢!
fnc = Dataset(ncfile, 'r')
lat = fnc.variables['latitude'][:]
lon = fnc.variables['longitude'][:]
level = fnc.variables['level']
mydata = fnc.variables['Data'][:]
imgplot = plt.imshow(mydata[0, 0, :, :])
imgplot.set_cmap('RdYlGn')
plt.colorbar()
plt.show
m = Basemap(llcrnrlon = -180, llcrnrlat = -90, urcrnrlon = 180, urcrnrlat= +90, resolution = 'l', epsg=4326)
x, y = m(lon, lat)
im = m.imshow(mydata[0, 0, :, :])
m.drawcoastlines()
plt.show()