Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2c2ff2d

Browse filesBrowse files
committed
Add test for quiverkey with multiple angles
1 parent d705dbd commit 2c2ff2d
Copy full SHA for 2c2ff2d

File tree

Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed

‎lib/matplotlib/tests/test_quiver.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_quiver.py
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,20 @@ def test_bad_masked_sizes():
161161
ax.barbs(x, y, u, v)
162162

163163

164+
def test_quiverkey_angles():
165+
# Check that only a single arrow is plotted for a quiverkey when an array
166+
# of angles is given to the original quiver plot
167+
fig, ax = plt.subplots()
168+
169+
X, Y = np.meshgrid(np.arange(2), np.arange(2))
170+
U = V = angles = np.ones_like(X)
171+
172+
q = ax.quiver(X, Y, U, V, angles=angles)
173+
qk = ax.quiverkey(q, 1, 1, 2, 'Label')
174+
# The arrows are only created when the key is drawn
175+
fig.canvas.draw()
176+
assert len(qk.verts) == 1
177+
164178
if __name__ == '__main__':
165179
import nose
166180
nose.runmodule()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.