Skip to content

Commit 649eb6d

Browse files
committed
Add a simple quiver example
1 parent b8e0f82 commit 649eb6d

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'''A simple example of a quiverplt, with a quiverkey.'''
2+
import matplotlib.pyplot as plt
3+
import numpy as np
4+
5+
X = np.arange(-10, 10, 1)
6+
Y = np.arange(-10, 10, 1)
7+
U, V = np.meshgrid(X, Y)
8+
9+
fig, ax = plt.subplots()
10+
q = ax.quiver(X, Y, U, V)
11+
ax.quiverkey(q, X=0.3, Y=1.1, U=10,
12+
label='Quiver key, length = 10', labelpos='E')
13+
14+
plt.show()

‎lib/matplotlib/quiver.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
of values in degrees, counter-clockwise from the horizontal axis.
111111
112112
Note: inverting a data axis will correspondingly invert the
113-
arrows only with ``angles='xy'```.
113+
arrows only with ``angles='xy'``.
114114
scale : None, float, optional
115115
Number of data units per arrow length unit, e.g., m/s per plot width; a
116116
smaller scale parameter makes the arrow longer. Default is *None*.
@@ -165,6 +165,10 @@
165165
166166
%(PolyCollection)s
167167
168+
Examples
169+
--------
170+
.. plot:: mpl_examples/pylab_examples/quiver_simple_demo.py
171+
168172
See Also
169173
--------
170174
quiverkey : Add a key to a quiver plot

0 commit comments

Comments
 (0)