簡體   English   中英

有沒有辦法在沒有顫動的情況下繪制顫動鍵或將顫動隱藏在matplotlib中?

[英]is there a way to plot a quiverkey without a quiver or hiding the quiver in matplotlib?

我正在學習這篇文章

這是我的代碼

f, ax = plt.subplots()
ax.set_xlim([-1, 1])
ax.set_ylim([-1, 1])
Q = ax.quiver(0,0,0,1)
qk = plt.quiverkey(Q, .8, .8, 5, r'$2 \frac{m}{s}$', labelpos='E',
                   coordinates='figure', color='r')

5

我需要的只是紅色的(帶有標簽的箭頭),有沒有辦法在沒有顫動的情況下繪制顫動鍵或將顫動隱藏在matplotlib中?

我想到的最簡單的方法是使用'none'作為顏色。 即使color='white'也能勝任,但我更喜歡'none'

Q = ax.quiver(0,0,0,1, color='none')
qk = plt.quiverkey(Q, .8, .8, 5, r'$2 \frac{m}{s}$', labelpos='E',
               coordinates='figure', color='r')

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM