Set `.Arrow` x, y, dx, dy and width. Values left as None will not be updated. Parameters ---------- x, y : float or None, default: None The x and y coordinates of the arrow base. dx, dy : float or None, default: None The leng
(self, x=None, y=None, dx=None, dy=None, width=None)
| 1466 | return self._patch_transform |
| 1467 | |
| 1468 | def set_data(self, x=None, y=None, dx=None, dy=None, width=None): |
| 1469 | """ |
| 1470 | Set `.Arrow` x, y, dx, dy and width. |
| 1471 | Values left as None will not be updated. |
| 1472 | |
| 1473 | Parameters |
| 1474 | ---------- |
| 1475 | x, y : float or None, default: None |
| 1476 | The x and y coordinates of the arrow base. |
| 1477 | |
| 1478 | dx, dy : float or None, default: None |
| 1479 | The length of the arrow along x and y direction. |
| 1480 | |
| 1481 | width : float or None, default: None |
| 1482 | Width of full arrow tail. |
| 1483 | """ |
| 1484 | if x is not None: |
| 1485 | self._x = x |
| 1486 | if y is not None: |
| 1487 | self._y = y |
| 1488 | if dx is not None: |
| 1489 | self._dx = dx |
| 1490 | if dy is not None: |
| 1491 | self._dy = dy |
| 1492 | if width is not None: |
| 1493 | self._width = width |
| 1494 | self._patch_transform = ( |
| 1495 | transforms.Affine2D() |
| 1496 | .scale(np.hypot(self._dx, self._dy), self._width) |
| 1497 | .rotate(np.arctan2(self._dy, self._dx)) |
| 1498 | .translate(self._x, self._y) |
| 1499 | .frozen()) |
| 1500 | |
| 1501 | |
| 1502 | class FancyArrow(Polygon): |