微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

矢量形式的垂直风可视化

如何解决矢量形式的垂直风可视化

我有掩码数组格式的垂直风数据,我想将其绘制成矢量形式。

masked_array(
  data=[[-4.06932000e-04,-4.06932000e-04,-5.70601827e-04,...,-2.43262173e-04,-4.06932000e-04],[-1.38895096e-03,-8.97941481e-04,-7.95923461e-05,2.47747308e-04],[ 2.47747308e-04,5.75086961e-04,1.22976627e-03,7.38756788e-04,4.11417135e-04,8.40774808e-05],[ 5.50771393e-02,3.57640997e-02,5.21310824e-02,-4.98352197e-02,-2.95401612e-02,-3.90330111e-02],[ 6.03145738e-02,3.28180429e-02,4.96760350e-02,-2.65941043e-02,-2.38117172e-02,-3.33045672e-02],[ 5.75321867e-02,3.34727222e-02,4.95123652e-02,5.97619125e-03,5.32151194e-03,2.53912488e-03]],mask=False,fill_value=1e+20)

我尝试了以下方法

import matplotlib.pyplot as plt
import numpy as np
from netCDF4 import Dataset as ncfile
import cartopy.crs as ccrs

nc = ncfile('data.nc')

lats = nc.variables['latitude'][:]
p = nc.variables['level'][:]

w = (nc.variables['w'][0,:,95])


fig = plt.figure(figsize=(11,8))
ax1 = fig.add_subplot(111)

ax1.axis([-10,40,1000,200])
ax1.yaxis.get_ticklocs(minor=True)     
ax1.minorticks_on()
ax1.tick_params(direction='out',which='both')
ax1.set_xlabel('Latitude (degrees)',fontsize=12,fontweight='bold')
ax1.set_ylabel('Pressure (mb)',fontweight='bold')
ax1.set_xticks(np.arange(-10,4))
ax1.set_yticks([1000,900,800,700,600,500,400,300,200])

#-- vertical wind vector
plt.quiver(lats,p,w,scale=10)

plt.savefig('sample.png')

它以下列方式显示,但我希望它变成等间距或**流**形式。

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。