Quiver Simple DemoΒΆ

A simple example of a quiver plot with a quiverkey.

For more advanced options refer to Advanced quiver and quiverkey functions.

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')

quiver simple demo


The use of the following functions, methods, classes and modules is shown in this example:

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

Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery