[英]How to plot matplotlib quiver arrows over x-axis and y-axis? - Python
目前我用 matplotlib 制成的 plot 看起來像圖 1,正如您在 x 軸上看到的那樣,我的箭頭的一半被軸覆蓋。
我想要它,所以整個箭頭如圖 2 所示。
這是我的代碼的相關部分,X_fine 和 Y_fine 與 X 和 Y 具有相同的范圍,但具有更多的 bin。
X, Y = np.meshgrid(arrow_csf_centre, arrow_precip_centre)
X_fine, Y_fine = np.meshgrid(arrow_csf_centre_fine, arrow_precip_centre_fine)
plt.contourf(X_fine, Y_fine, np.transpose(counts2_fine), 30)
plt.quiver(X,
Y,
np.transpose(arrow_dirs[:,:,0]),
np.transpose(arrow_dirs[:,:,1]),
angles='xy',
scale_units='xy',
scale=1,
pivot='mid')
謝謝閱讀!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.