Skip to content

Commit a63fd7f

Browse files
committed
Remove old simple quiver demo
1 parent 0e6b08e commit a63fd7f

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

examples/pylab_examples/quiver_demo.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
'''
2-
Demonstration of quiver and quiverkey functions. This is using the
3-
new version coming from the code in quiver.py.
2+
Demonstration of advanced quiver and quiverkey functions.
43
54
Known problem: the plot autoscaling does not take into account
65
the arrows, so those on the boundaries are often out of the picture.
76
This is *not* an easy problem to solve in a perfectly general way.
87
The workaround is to manually expand the axes.
9-
108
'''
119
import matplotlib.pyplot as plt
1210
import numpy as np
@@ -16,18 +14,6 @@
1614
U = np.cos(X)
1715
V = np.sin(Y)
1816

19-
# 1
20-
plt.figure()
21-
Q = plt.quiver(U, V)
22-
qk = plt.quiverkey(Q, 0.5, 0.98, 2, r'$2 \frac{m}{s}$', labelpos='W',
23-
fontproperties={'weight': 'bold'})
24-
l, r, b, t = plt.axis()
25-
dx, dy = r - l, t - b
26-
plt.axis([l - 0.05*dx, r + 0.05*dx, b - 0.05*dy, t + 0.05*dy])
27-
28-
plt.title('Minimal arguments, no kwargs')
29-
30-
# 2
3117
plt.figure()
3218
Q = plt.quiver(X, Y, U, V, units='width')
3319
qk = plt.quiverkey(Q, 0.9, 0.95, 2, r'$2 \frac{m}{s}$',
@@ -37,7 +23,6 @@
3723
plt.axis([-1, 7, -1, 7])
3824
plt.title('scales with plot width, not view')
3925

40-
# 3
4126
plt.figure()
4227
Q = plt.quiver(X[::3, ::3], Y[::3, ::3], U[::3, ::3], V[::3, ::3],
4328
pivot='mid', color='r', units='inches')
@@ -47,7 +32,6 @@
4732
plt.axis([-1, 7, -1, 7])
4833
plt.title("pivot='mid'; every third arrow; units='inches'")
4934

50-
# 4
5135
plt.figure()
5236
M = np.hypot(U, V)
5337
Q = plt.quiver(X, Y, U, V, M,
@@ -62,7 +46,6 @@
6246
plt.axis([-1, 7, -1, 7])
6347
plt.title("scales with x view; pivot='tip'")
6448

65-
# 5
6649
plt.figure()
6750
Q = plt.quiver(X[::3, ::3], Y[::3, ::3], U[::3, ::3], V[::3, ::3],
6851
color='r', units='x',
@@ -72,7 +55,6 @@
7255
plt.axis([-1, 7, -1, 7])
7356
plt.title("triangular head; scale with x view; black edges")
7457

75-
# 6
7658
plt.figure()
7759
M = np.zeros(U.shape, dtype='bool')
7860
XMaskStart = U.shape[0]//3
@@ -85,7 +67,7 @@
8567
U = ma.masked_array(U, mask=M)
8668
V = ma.masked_array(V, mask=M)
8769
Q = plt.quiver(U, V)
88-
qk = plt.quiverkey(Q, 0.5, 0.98, 2, r'$2 \frac{m}{s}$', labelpos='W',
70+
qk = plt.quiverkey(Q, 0.5, 0.96, 2, r'$2 \frac{m}{s}$', labelpos='W',
8971
fontproperties={'weight': 'bold'})
9072
l, r, b, t = plt.axis()
9173
dx, dy = r - l, t - b

0 commit comments

Comments
 (0)