1
我試圖用羅賓遜投影繪製全球地圖上的流線,但底圖似乎不像預計的座標。當然,對於一個普通的舊圓柱投影,它在x方向上是規則的。你可以繪製羅賓遜預測的流線嗎?
下面是一個例子:
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np
u = np.ones((21,21))
v = np.ones((21,21))
lats = np.arange(-90,91,9)
lons = np.arange(-180,181,18)
x,y = np.meshgrid(lons,lats)
# It works for Cylindrical
mp = Basemap(projection='cyl')
xx,yy = mp(x,y)
mp.streamplot(xx,yy,u,v)
mp.drawcoastlines()
plt.show()
# But not Robinson
mp = Basemap(projection='robin',lon_0=0)
xx, yy = mp(x, y)
mp.streamplot(xx,yy,u,v)
mp.drawcoastlines()
plt.show()
它抱怨的X座標,養:
ValueError: The rows of 'x' must be equal
所以是有可能的情節簡化羅賓遜預測?