Skip to content

Commit 4b7cd92

Browse files
committed
Bug: 2671465 quiver plot adds unwanted lines to image
svn path=/trunk/matplotlib/; revision=7207
1 parent 81be3d6 commit 4b7cd92

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/quiver.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,10 @@ def _h_arrows(self, length):
500500
minsh = self.minshaft * self.headlength
501501
N = len(length)
502502
length = length.reshape(N, 1)
503+
# This number is chosen based on when pixel values overflow in Agg
504+
# causing rendering errors
505+
length = np.minimum(length, 2 ** 16)
506+
503507
# x, y: normal horizontal arrow
504508
x = np.array([0, -self.headaxislength,
505509
-self.headlength, 0], np.float64)

0 commit comments

Comments
 (0)