8000 Clean up quiver docstring + add simple quiver example by dstansby · Pull Request #7913 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Clean up quiver docstring + add simple quiver example #7913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 29, 2017
Prev Previous commit
Next Next commit
Add a simple quiver example
  • Loading branch information
dstansby committed Jan 22, 2017
commit 649eb6d1f597eaffbb869c72cc2b8640a5ffdfd0
14 changes: 14 additions & 0 deletions examples/pylab_examples/quiver_simple_demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'''A simple example of a quiverplt, with a quiverkey.'''
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()
6 changes: 5 additions & 1 deletion lib/matplotlib/quiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
of values in degrees, counter-clockwise from the horizontal axis.

Note: inverting a data axis will correspondingly invert the
arrows only with ``angles='xy'```.
arrows only with ``angles='xy'``.
scale : None, float, optional
Number of data units per arrow length unit, e.g., m/s per plot width; a
smaller scale parameter makes the arrow longer. Default is *None*.
Expand Down Expand Up @@ -165,6 +165,10 @@

%(PolyCollection)s

Examples
--------
.. plot:: mpl_examples/pylab_examples/quiver_simple_demo.py

See Also
--------
quiverkey : Add a key to a quiver plot
Expand Down
0