MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_unautoscale

Function test_unautoscale

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py:1318–1335  ·  view source on GitHub ↗
(axis, auto)

Source from the content-addressed store, hash-verified

1316@pytest.mark.parametrize('axis', ('x', 'y', 'z'))
1317@pytest.mark.parametrize('auto', (True, False, None))
1318def 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()

Callers

nothing calls this directly

Calls 4

figureMethod · 0.80
add_subplotMethod · 0.80
scatterMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…