File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1507,8 +1507,8 @@ def apply_aspect(self, position=None):
1507
1507
return
1508
1508
1509
1509
dL = self .dataLim
1510
- x0 , x1 = map (x_trf .inverted (). transform , dL .intervalx )
1511
- y0 , y1 = map (y_trf .inverted (). transform , dL .intervaly )
1510
+ x0 , x1 = map (x_trf .transform , dL .intervalx )
1511
+ y0 , y1 = map (y_trf .transform , dL .intervaly )
1512
1512
xr = 1.05 * (x1 - x0 )
1513
1513
yr = 1.05 * (y1 - y0 )
1514
1514
Original file line number Diff line number Diff line change @@ -6554,9 +6554,12 @@ def test_aspect_nonlinear_adjustable_datalim():
6554
6554
6555
6555
ax = fig .add_axes ([.1 , .1 , .8 , .8 ]) # Square.
6556
6556
ax .plot ([.4 , .6 ], [.4 , .6 ]) # Set minpos to keep logit happy.
6557
- ax .set (xscale = "log" , xlim = (1 , 10 ),
6558
- yscale = "logit" , ylim = (1 / 11 , 1 / 1001 ),
6557
+ ax .set (xscale = "log" , xlim = (1 , 100 ),
6558
+ yscale = "logit" , ylim = (1 / 101 , 1 / 11 ),
6559
6559
aspect = 1 , adjustable = "datalim" )
6560
6560
ax .margins (0 )
6561
6561
ax .apply_aspect ()
6562
- assert ax .get_xlim () == pytest .approx (np .array ([1 / 10 , 10 ]) * np .sqrt (10 ))
6562
+ # Currently the autoscaler chooses to reduce the x-limits by half a decade
6563
+ # on each end, but this may change later.
6564
+ assert ax .get_xlim () == pytest .approx ([1 * 10 ** (1 / 2 ), 100 / 10 ** (1 / 2 )])
6565
+ assert ax .get_ylim () == (1 / 101 , 1 / 11 )
You can’t perform that action at this time.
0 commit comments