亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Matplotlib 極坐標輪廓圖:跨 theta 原點連續

Matplotlib 極坐標輪廓圖:跨 theta 原點連續

慕尼黑5688855 2021-10-12 10:15:15
我有格式E( freq, theta) 的數據,其中E是二維數組,freq和theta是一維數組。以下代碼部分生成附圖。但是,我想使輪廓圖在 0 度原點上連續(即,沿 0 方位角沒有白色空間的楔形)。我已經瀏覽了 matplotlib 文檔,并非常廣泛地發布了問題,但似乎無法找到解決此問題的方法。有任何想法嗎?代碼:[r, th] = np.meshgrid(freq,theta)fig = plt.figure()ax = fig.add_subplot(111, polar=True)ax.set_theta_zero_location('N')ax.set_theta_direction(-1)cntf = ax.contourf(th,r,np.log10(E),cmap='jet',extend='both',    levels=np.linspace(np.mean(np.log10(E)), np.amax(np.log10(E)), 15))ax.set_rlim(0, .3)label_position=ax.get_rlabel_position()ax.text(np.radians(label_position+25),ax.get_rmax()/1.5,'f (Hz)',        rotation=label_position,ha='center',va='center')產生的情節:
查看完整描述

1 回答

?
Helenr

TA貢獻1780條經驗 獲得超4個贊

http://img1.sycdn.imooc.com//6164efd90001c6ae02960280.jpg

dtheta = np.diff(theta).mean()

wrp_theta = np.concatenate((theta, theta[-1:] + dtheta))

wrp_E = np.concatenate((E, E[0:1, :]), axis=0)


查看完整回答
反對 回復 2021-10-12
  • 1 回答
  • 0 關注
  • 338 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號