Skip to content

Linewidth(s) keywords not working with quiver #8630

@Silmathoron

Description

@Silmathoron

Cannot set different arrow sizes using quiver

This seems to be a regression in the behaviour of the quiver function

According to this SO post, quiver used to accept a linewidths array argument to set the arrow sizes; however, this is no longer true with 2.02 on Py2/3K.
The linewidth item pops 5 times in quiver.py though.

Code for reproduction
From the SO post, but the code (reported as working) does not work on my install.

import matplotlib.pyplot as plt
import numpy as np
sin = np.sin
cos = np.cos

# http://stackoverflow.com/questions/6370742/#6372413
xmax = 4.0
xmin = -xmax
D = 20
ymax = 4.0
ymin = -ymax
x = np.linspace(xmin, xmax, D)
y = np.linspace(ymin, ymax, D)
X, Y = np.meshgrid(x, y)
# plots the vector field for Y'=Y**3-3*Y-X
deg = np.arctan(Y ** 3 - 3 * Y - X)
widths = np.linspace(0, 2, X.size)
plt.quiver(X, Y, cos(deg), sin(deg), linewidths=widths)
plt.show()

Actual outcome

Output is the same as that of the initial SO post where the linewidths keyword is not set.

Matplotlib version

  • Operating System: Manjaro
  • Matplotlib Version: 2.02
  • Python Version: 2.7.13 & 3.6.1
  • Jupyter Version (if applicable): /
  • Other Libraries: numpy 1.12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions