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

Method __init__

lib/matplotlib/lines.py:1499–1521  ·  view source on GitHub ↗

Parameters ---------- xy1 : (float, float) The first set of (x, y) coordinates for the line to pass through. xy2 : (float, float) or None The second set of (x, y) coordinates for the line to pass through. Both *xy2* and *slope* mus

(self, xy1, xy2, slope, **kwargs)

Source from the content-addressed store, hash-verified

1497 """
1498
1499 def __init__(self, xy1, xy2, slope, **kwargs):
1500 """
1501 Parameters
1502 ----------
1503 xy1 : (float, float)
1504 The first set of (x, y) coordinates for the line to pass through.
1505 xy2 : (float, float) or None
1506 The second set of (x, y) coordinates for the line to pass through.
1507 Both *xy2* and *slope* must be passed, but one of them must be None.
1508 slope : float or None
1509 The slope of the line. Both *xy2* and *slope* must be passed, but one of
1510 them must be None.
1511 """
1512 super().__init__([0, 1], [0, 1], **kwargs)
1513
1514 if (xy2 is None and slope is None or
1515 xy2 is not None and slope is not None):
1516 raise TypeError(
1517 "Exactly one of 'xy2' and 'slope' must be given")
1518
1519 self._slope = slope
1520 self._xy1 = xy1
1521 self._xy2 = xy2
1522
1523 def get_transform(self):
1524 ax = self.axes

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected