@@ -1553,18 +1553,28 @@ def get_slope(self):
15531553 """Return the *slope* value of the line."""
15541554 return self ._slope
15551555
1556- def set_xy1 (self , x , y ):
1556+ def set_xy1 (self , * args , ** kwargs ):
15571557 """
15581558 Set the *xy1* value of the line.
15591559
15601560 Parameters
15611561 ----------
1562- x, y : float
1562+ xy1 : tuple[ float, float]
15631563 Points for the line to pass through.
15641564 """
1565- self ._xy1 = x , y
1565+ params = _api .select_matching_signature ([
1566+ lambda self , x , y : locals (), lambda self , xy1 : locals (),
1567+ ], self , * args , ** kwargs )
1568+ if "x" in params :
1569+ _api .warn_deprecated ("3.10" , message = (
1570+ "Passing x and y separately to AxLine.set_xy1 is deprecated since "
1571+ "%(since)s; pass them as a single tuple instead." ))
1572+ xy1 = params ["x" ], params ["y" ]
1573+ else :
1574+ xy1 = params ["xy1" ]
1575+ self ._xy1 = xy1
15661576
1567- def set_xy2 (self , x , y ):
1577+ def set_xy2 (self , * args , ** kwargs ):
15681578 """
15691579 Set the *xy2* value of the line.
15701580
@@ -1576,11 +1586,21 @@ def set_xy2(self, x, y):
15761586
15771587 Parameters
15781588 ----------
1579- x, y : float
1589+ xy2 : tuple[ float, float]
15801590 Points for the line to pass through.
15811591 """
15821592 if self ._slope is None :
1583- self ._xy2 = x , y
1593+ params = _api .select_matching_signature ([
1594+ lambda self , x , y : locals (), lambda self , xy2 : locals (),
1595+ ], self , * args , ** kwargs )
1596+ if "x" in params :
1597+ _api .warn_deprecated ("3.10" , message = (
1598+ "Passing x and y separately to AxLine.set_xy2 is deprecated since "
1599+ "%(since)s; pass them as a single tuple instead." ))
1600+ xy2 = params ["x" ], params ["y" ]
1601+ else :
1602+ xy2 = params ["xy2" ]
1603+ self ._xy2 = xy2
15841604 else :
15851605 raise ValueError ("Cannot set an 'xy2' value while 'slope' is set;"
15861606 " they differ but their functionalities overlap" )
0 commit comments