Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
AddU,V andC setter toQuiver#26410
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
b26858510adf0b92848b2e5b42b1c8d4924aba8d9b9b5bc95File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
quiver.Quiver.Umask- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -325,7 +325,7 @@ def _init(self): | ||
| self._set_transform() | ||
| with cbook._setattr_cm(self.Q, pivot=self.pivot[self.labelpos], | ||
| # Hack: save and restore the Umask | ||
| _Umask=ma.nomask): | ||
| u = self.U * np.cos(np.radians(self.angle)) | ||
| v = self.U * np.sin(np.radians(self.angle)) | ||
| self.verts = self.Q._make_verts([[0., 0.]], | ||
| @@ -469,6 +469,7 @@ class Quiver(mcollections.PolyCollection): | ||
| """ | ||
| _PIVOT_VALS = ('tail', 'middle', 'tip') | ||
| Umask = _api.deprecate_privatize_attribute("3.9") | ||
| @_docstring.Substitution(_quiver_doc) | ||
| def __init__(self, ax, *args, | ||
| @@ -769,7 +770,7 @@ def set_XYUVC(self, X=None, Y=None, U=None, V=None, C=None): | ||
| C = ma.array(C, mask=mask, copy=False) | ||
| self._U = U.filled(1) | ||
| self._V = V.filled(1) | ||
| self._Umask = mask | ||
| if C is not None: | ||
| self.set_array(C) | ||
| self._N = N | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is unused now, as | ||
| @@ -836,8 +837,8 @@ def _make_verts(self, XY, U, V, angles): | ||
| if self.scale is None: | ||
| sn = max(10, math.sqrt(len(self.get_offsets()))) | ||
| if self._Umask is not ma.nomask: | ||
| amean = a[~self._Umask].mean() | ||
| else: | ||
| amean = a.mean() | ||
| # crude auto-scaling | ||
| @@ -867,9 +868,9 @@ def _make_verts(self, XY, U, V, angles): | ||
| theta = theta.reshape((-1, 1)) # for broadcasting | ||
| xy = (X + Y * 1j) * np.exp(1j * theta) * self.width | ||
| XY = np.stack((xy.real, xy.imag), axis=2) | ||
| if self._Umask is not ma.nomask: | ||
| XY = ma.array(XY) | ||
| XY[self._Umask] = ma.masked | ||
| # This might be handled more efficiently with nans, given | ||
| # that nans will end up in the paths anyway. | ||