matplotlib / matplotlib/matplotlib

[Bug]: pyplot.quiverkey does not work as expected with polar subplots

未關閉
#26,748 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

topic: polar
主要語言
Python
星號
23.2k
分支
8.5k
平均合併
1 天 6 小時
30 天內合併 PR
66

描述

Bug summary

pyplot.quiverkey does not work correctly in polar plots.

Code for reproduction
import numpy as np
from matplotlib import pyplot as plt

fig, ax = plt.subplots(subplot_kw={"polar": True})

longitude = np.arange(0, 360, 10)
colatitude = 90 - np.ones_like(longitude) * 60

sample_x = np.ones_like(longitude)       # Northward
sample_y = np.zeros_like(longitude)      # Eastward

q = ax.quiver(np.radians(longitude), colatitude, sample_y, -sample_x, angles="xy")
ax.quiverkey(q, X=0, Y=0, U=5, label='5 units')
Actual outcome

Unknown

Expected outcome

The quiverkey should be a single line rather than a cartwheel.

Additional information

No response

Operating system

macOS Ventura 13.5

Matplotlib Version

3.7.1

Matplotlib Backend

Installed osx event loop hook. MacOSX

Python version

3.10.11

Jupyter version

4.0.1

Installation

conda

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,使用極座標 subplot 執行提供的 Python reproduction,並檢查 pyplot.quiverkey 的路徑及相關的 quiver-key 處理。將極座標結果與非極座標圖進行比較;完成的標準是極座標 quiver key 渲染為一條線而不是一個輪子,同時保留預期的 5 單位標籤。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
data-visualization
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。