Skip to content

[Bug]: quiverkey shows multiple arrows under geographical projection and angle='xy' #26316

Closed
@xlucn

Description

@xlucn

Bug summary

When I plot quiverkey with subplot option projection='aitoff' and quiver option angle='xy', the quiverkey is then showing multiple arrows pointing at different directions.

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(-np.pi, np.pi, 11)
y = np.ones_like(x) * np.pi / 6
vx = np.zeros_like(x)
vy = np.ones_like(x)

fig = plt.figure()
ax = fig.add_subplot(projection='aitoff')
q = ax.quiver(x, y, vx, vy, angles='xy')
ax.quiverkey(q, 0, 0, 1, '1 units')
ax.grid()
plt.show()

Actual outcome

quiver_anglexy

Expected outcome

I naturally expect the quiverkey to be as in the image below, with the default angle='uv' option:

quiver_angleuv

Additional information

No response

Operating system

Arch Linux

Matplotlib Version

3.7.1

Matplotlib Backend

QtAgg

Python version

Python 3.11.3

Jupyter version

No response

Installation

Linux package manager

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions