@@ -1442,6 +1442,7 @@ def _make_verts(self, t, f1, f2, where, interpolate, step):
1442
1442
for idx0 , idx1 in cbook .contiguous_regions (where )
1443
1443
]
1444
1444
1445
+ # prepare the datalim for autoscale
1445
1446
bbox = transforms .Bbox .null ()
1446
1447
bbox .update_from_data_xy (self ._normalize_pts (np .vstack ([
1447
1448
np .hstack ([t [where , None ], f [where , None ]]) for f in (f1 , f2 )])))
@@ -1461,9 +1462,6 @@ def _make_verts_per_region(self, t, f1, f2, idx0, idx1, step, interpolate):
1461
1462
step_func = cbook .STEP_LOOKUP_MAP ["steps-" + step ]
1462
1463
t_slice , f1_slice , f2_slice = step_func (t_slice , f1_slice , f2_slice )
1463
1464
1464
- size = len (t_slice )
1465
- pts = np .zeros ((2 * size + 2 , 2 ))
1466
-
1467
1465
if interpolate :
1468
1466
start = self ._get_interp_point (t , f1 , f2 , idx0 )
1469
1467
end = self ._get_interp_point (t , f1 , f2 , idx1 )
@@ -1473,13 +1471,11 @@ def _make_verts_per_region(self, t, f1, f2, idx0, idx1, step, interpolate):
1473
1471
start = t_slice [0 ], f2_slice [0 ]
1474
1472
end = t_slice [- 1 ], f2_slice [- 1 ]
1475
1473
1476
- pts [0 ] = start
1477
- pts [size + 1 ] = end
1478
-
1479
- pts [1 :size + 1 , 0 ] = t_slice
1480
- pts [1 :size + 1 , 1 ] = f1_slice
1481
- pts [size + 2 :, 0 ] = t_slice [::- 1 ]
1482
- pts [size + 2 :, 1 ] = f2_slice [::- 1 ]
1474
+ pts = np .concatenate ((
1475
+ np .asarray ([start ]),
1476
+ np .stack ((t_slice , f1_slice ), axis = - 1 ),
1477
+ np .asarray ([end ]),
1478
+ np .stack ((t_slice , f2_slice ), axis = - 1 )[::- 1 ]))
1483
1479
1484
1480
return self ._normalize_pts (pts )
1485
1481
0 commit comments