[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/stable/api/_as_gen/../../plot_types/3D/../unstructured/../arrays/quiver.html [Back]  [Original]

quiver(X, Y, U, V) — Matplotlib 3.11.2 documentation
Back to top
Search the docs ...:

quiver(X, Y, U, V)#

Plot a 2D field of arrows.

See quiver.

quiver [quiver]
import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery-nogrid')

# make data
x = np.linspace(-4, 4, 6)
y = np.linspace(-4, 4, 6)
X, Y = np.meshgrid(x, y)
U = X + Y
V = Y - X

# plot
fig, ax = plt.subplots()

ax.quiver(X, Y, U, V, color="C0", angles='xy',
          scale_units='xy', scale=5, width=.015)

ax.set(xlim=(-5, 5), ylim=(-5, 5))

plt.show()

Gallery generated by Sphinx-Gallery


Web Proxy Viewer  |  New URL  |  Original Page