MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_data

Method set_data

lib/matplotlib/patches.py:1468–1499  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
1502class FancyArrow(Polygon):

Callers 2

__init__Method · 0.95
test_arrow_set_dataFunction · 0.95

Calls 4

translateMethod · 0.80
frozenMethod · 0.45
rotateMethod · 0.45
scaleMethod · 0.45

Tested by 1

test_arrow_set_dataFunction · 0.76