You are reading an old version of the documentation (v2.1.1). For the latest version see https://matplotlib.org/stable/gallery/images_contours_and_fields/quiver_simple_demo.html
matplotlib
Fork me on GitHub


Travis-CI:

Related Topics

This Page

Quiver Simple DemoΒΆ

A simple example of a quiver plot with a quiverkey.

../../_images/sphx_glr_quiver_simple_demo_001.png
import matplotlib.pyplot as plt
import numpy as np

X = np.arange(-10, 10, 1)
Y = np.arange(-10, 10, 1)
U, V = np.meshgrid(X, Y)

fig, ax = plt.subplots()
q = ax.quiver(X, Y, U, V)
ax.quiverkey(q, X=0.3, Y=1.1, U=10,
             label='Quiver key, length = 10', labelpos='E')

plt.show()

Total running time of the script: ( 0 minutes 0.017 seconds)

Gallery generated by Sphinx-Gallery