|
247 | 247 |
|
248 | 248 | Notes |
249 | 249 | ----- |
| 250 | +**Data shape** |
| 251 | +
|
| 252 | +2D inputs for *X*, *Y*, *U*, *V*, *C* are only for convenience. The internal |
| 253 | +storage and thus the respective attributes are always a ravelled 1D array. |
250 | 254 |
|
251 | 255 | **Arrow shape** |
252 | 256 |
|
@@ -446,6 +450,13 @@ def _parse_args(*args, caller_name='function'): |
446 | 450 |
|
447 | 451 | caller_name : str |
448 | 452 | Name of the calling method (used in error messages). |
| 453 | +
|
| 454 | + Returns |
| 455 | + ------- |
| 456 | + X, Y : ndarray |
| 457 | + Position coordinates as ravelled 1d arrays. |
| 458 | + U, V, C : ndarray or None |
| 459 | + Arrow direction components and numeric data as passed in. |
449 | 460 | """ |
450 | 461 | X = Y = C = None |
451 | 462 |
|
@@ -584,6 +595,26 @@ def draw(self, renderer): |
584 | 595 | self.stale = False |
585 | 596 |
|
586 | 597 | def set_UVC(self, U, V, C=None): |
| 598 | + """ |
| 599 | + Update the quiver arrow directions and color. |
| 600 | +
|
| 601 | + Parameters |
| 602 | + ---------- |
| 603 | + U, V : 1D or 2D array-like |
| 604 | + The new x and y direction components of the arrow vectors. See also |
| 605 | + *U*, *V* in the `.Quiver` documentation. |
| 606 | + C : 1D or 2D array-like, optional |
| 607 | + Numeric data to be colormapped for each arrow. See also the |
| 608 | + `.Quiver` documentation. If not given, previous *C* values are |
| 609 | + preserved. |
| 610 | +
|
| 611 | + Notes |
| 612 | + ----- |
| 613 | + *U*, *V*, and *C* must have the same number of elements as there are |
| 614 | + arrows in the Quiver. If you want to change the number / positions of |
| 615 | + arrows as well, update `.Quiver.set_offsets` before calling |
| 616 | + `.Quiver.set_UVC`. |
| 617 | + """ |
587 | 618 | # We need to ensure we have a copy, not a reference |
588 | 619 | # to an array that might change before draw(). |
589 | 620 | U = ma.masked_invalid(U, copy=True).ravel() |
@@ -1162,6 +1193,26 @@ def _make_barbs(self, u, v, nflags, nbarbs, half_barb, empty_flag, length, |
1162 | 1193 | return barb_list |
1163 | 1194 |
|
1164 | 1195 | def set_UVC(self, U, V, C=None): |
| 1196 | + """ |
| 1197 | + Update the barb directions and colors. |
| 1198 | +
|
| 1199 | + Parameters |
| 1200 | + ---------- |
| 1201 | + U, V : 1D or 2D array-like |
| 1202 | + The new x and y direction components of the barbs. See also |
| 1203 | + *U*, *V* in the `.Barbs` documentation. |
| 1204 | + C : 1D or 2D array-like, optional |
| 1205 | + Numeric data to be colormapped for each barb. See also the |
| 1206 | + `.Barbs` documentation. If not given, previous *C* values are |
| 1207 | + preserved. |
| 1208 | +
|
| 1209 | + Notes |
| 1210 | + ----- |
| 1211 | + *U*, *V*, and *C* must have the same number of elements as there are |
| 1212 | + arrows in the Quiver. If you want to change the number / positions of |
| 1213 | + arrows as well, update `.Barbs.set_offsets` before calling |
| 1214 | + `.Barbs.set_UVC`. |
| 1215 | + """ |
1165 | 1216 | # We need to ensure we have a copy, not a reference to an array that |
1166 | 1217 | # might change before draw(). |
1167 | 1218 | self.u = ma.masked_invalid(U, copy=True).ravel() |
|
0 commit comments