Skip to content

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

@johncoxon

Description

@johncoxon

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions