简体   繁体   English

matplotlib Polar Streamplot vs颤抖

[英]matplotlib polar streamplot vs quiver

I try to plot streamline then I see wrong result. 我尝试绘制流线型,然后看到错误的结果。 I check streamline with quiver then I get right result. 我检查颤抖,然后得到正确的结果。 I use same data for both. 两者都使用相同的数据。 Why plots is so different? 为什么地块如此不同?

fig = plt.figure()
axs = plt.axes(polar=True)
axs.set_theta_zero_location("N")
axs.set_theta_direction(-1)
YL, ZL = zip(*list(zip(YLr,ZLr))/np.linalg.norm(list(zip(YLr,ZLr)),axis=1, keepdims=True))
YLi = scipy.interpolate.griddata(((np.radians(a_izogn), izogn)),YL,(a_izogn_rad_i[None,:], izogn_i[:,None]),method='cubic')
ZLi = scipy.interpolate.griddata(((np.radians(a_izogn), izogn)),ZL,(a_izogn_rad_i[None,:], izogn_i[:,None]),method='cubic')
r = izogn_i
phi = a_izogn_rad_i
r, phi = np.meshgrid(r, phi)
axs.streamplot(phi.transpose(), r.transpose(),ZLi, YLi, color='red',density=1, linewidth=0.5)
axs.quiver(phi.transpose(), r.transpose(), ZLi, YLi,units='xy',scale=10., zorder=3, color='blue',width=0.007, headwidth=3., headlength=4.)
axs.set_ylim([min(izogn_i), max(izogn_i)])
fig.show();

样地

my data: https://cloud.mail.ru/public/HzJX/YFc1cLGGR 我的数据: https : //cloud.mail.ru/public/HzJX/YFc1cLGGR

solved. 解决了。 just plot contour in polar, streamline in cartesian 只是在极坐标中绘制轮廓,在笛卡尔坐标中简化

plot contour in polar, streamline in cartesian. 以极坐标绘制轮廓,以笛卡尔坐标绘制流线。 in result you can see: 结果,您可以看到:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM