(axis, auto)
| 1316 | @pytest.mark.parametrize('axis', ('x', 'y', 'z')) |
| 1317 | @pytest.mark.parametrize('auto', (True, False, None)) |
| 1318 | def test_unautoscale(axis, auto): |
| 1319 | fig = plt.figure() |
| 1320 | ax = fig.add_subplot(projection='3d') |
| 1321 | |
| 1322 | x = np.arange(100) |
| 1323 | y = np.linspace(-0.1, 0.1, 100) |
| 1324 | ax.scatter(x, y) |
| 1325 | |
| 1326 | get_autoscale_on = getattr(ax, f'get_autoscale{axis}_on') |
| 1327 | set_lim = getattr(ax, f'set_{axis}lim') |
| 1328 | get_lim = getattr(ax, f'get_{axis}lim') |
| 1329 | |
| 1330 | post_auto = get_autoscale_on() if auto is None else auto |
| 1331 | |
| 1332 | set_lim((-0.5, 0.5), auto=auto) |
| 1333 | assert post_auto == get_autoscale_on() |
| 1334 | fig.canvas.draw() |
| 1335 | np.testing.assert_array_equal(get_lim(), (-0.5, 0.5)) |
| 1336 | |
| 1337 | |
| 1338 | @check_figures_equal() |
nothing calls this directly
no test coverage detected
searching dependent graphs…