@@ -1456,14 +1456,18 @@ def get_transform(self):
1456
1456
(vxlo , vylo ), (vxhi , vyhi ) = ax .transScale .transform (ax .viewLim )
1457
1457
x , y = (ax .transAxes + ax .transData .inverted ()).transform (self ._xy1 )
1458
1458
1459
- # find intersections with view limits in either direction,
1460
- # and draw between the middle two points.
1461
- _ , start , stop , _ = sorted ([
1462
- (vxlo , y + (vxlo - x ) * self ._slope ),
1463
- (vxhi , y + (vxhi - x ) * self ._slope ),
1464
- (x + (vylo - y ) / self ._slope , vylo ),
1465
- (x + (vyhi - y ) / self ._slope , vyhi ),
1466
- ])
1459
+ if np .isclose (self ._slope , 0 ):
1460
+ start = vxlo , y
1461
+ stop = vxhi , y
1462
+ else :
1463
+ # find intersections with view limits in either direction,
1464
+ # and draw between the middle two points.
1465
+ _ , start , stop , _ = sorted ([
1466
+ (vxlo , y + (vxlo - x ) * self ._slope ),
1467
+ (vxhi , y + (vxhi - x ) * self ._slope ),
1468
+ (x + (vylo - y ) / self ._slope , vylo ),
1469
+ (x + (vyhi - y ) / self ._slope , vyhi ),
1470
+ ])
1467
1471
return (BboxTransformTo (Bbox ([start , stop ]))
1468
1472
+ ax .transLimits + ax .transAxes )
1469
1473
0 commit comments