Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13921

"2-dimensional boolean indexing" , the error of ax.quiver() function when use cartopy

$
0
0

An error: 2-dimensional boolean indexing is not supported. It appears when I want to draw wind field. I use ax.quiver() function of cartopy.

Here is the code:

dpath=r'E:\Data\Wind\era5wind2019.nc'd=xr.open_dataset(dpath)uw=d['u']vw=d['v']u=uw.loc['2019-01-01',:,:]v=vw.loc['2019-01-01',:,:]lat=uw.latitudelon=uw.longitudefig=plt.figure()ax=fig.add_subplot(111,projection=ccrs.PlateCarree(180))proj=ccrs.PlateCarree()Q = ax.quiver(        lon, lat, u, v, transform=proj,        regrid_shape=20, angles='uv',        scale=12, scale_units='xy',        units='width', width=0.002    )

Viewing all articles
Browse latest Browse all 13921

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>