Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59df055

Browse files
committed
Merged revisions 7827 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint ........ r7827 | efiring | 2009-09-25 13:56:14 -1000 (Fri, 25 Sep 2009) | 2 lines Fix bug in quiver handling of masked U, V ........ svn path=/trunk/matplotlib/; revision=7828
1 parent 7340864 commit 59df055

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/matplotlib/quiver.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,11 @@ def _make_verts(self, U, V):
518518
xy = (X+Y*1j) * np.exp(1j*theta)*self.width
519519
xy = xy[:,:,np.newaxis]
520520
XY = np.concatenate((xy.real, xy.imag), axis=2)
521+
if self.Umask is not ma.nomask:
522+
XY = ma.array(XY)
523+
XY[self.Umask] = ma.masked
524+
# This might be handled more efficiently with nans, given
525+
# that nans will end up in the paths anyway.
521526

522527
return XY
523528

@@ -575,10 +580,7 @@ def _h_arrows(self, length):
575580
tooshort = np.repeat(tooshort, 8, 1)
576581
np.putmask(X, tooshort, X1)
577582
np.putmask(Y, tooshort, Y1)
578-
if self.Umask is not ma.nomask:
579-
mask = np.repeat(self.Umask[:,np.newaxis], 8, 1)
580-
X = ma.array(X, mask=mask, copy=False)
581-
Y = ma.array(Y, mask=mask, copy=False)
583+
# Mask handling is deferred to the caller, _make_verts.
582584
return X, Y
583585

584586
quiver_doc = _quiver_doc

0 commit comments

Comments
 (0)