File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1507,8 +1507,8 @@ def apply_aspect(self, position=None):
15071507 return
15081508
15091509 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 )
15121512 xr = 1.05 * (x1 - x0 )
15131513 yr = 1.05 * (y1 - y0 )
15141514
Original file line number Diff line number Diff line change @@ -6554,9 +6554,12 @@ def test_aspect_nonlinear_adjustable_datalim():
65546554
65556555 ax = fig .add_axes ([.1 , .1 , .8 , .8 ]) # Square.
65566556 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 ),
65596559 aspect = 1 , adjustable = "datalim" )
65606560 ax .margins (0 )
65616561 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