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

Function test_set_zlim

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py:1860–1874  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1858
1859
1860def test_set_zlim():
1861 fig = plt.figure()
1862 ax = fig.add_subplot(projection='3d')
1863 assert np.allclose(ax.get_zlim(), (-1/48, 49/48))
1864 ax.set_zlim(zmax=2)
1865 assert np.allclose(ax.get_zlim(), (-1/48, 2))
1866 ax.set_zlim(zmin=1)
1867 assert ax.get_zlim() == (1, 2)
1868
1869 with pytest.raises(
1870 TypeError, match="Cannot pass both 'lower' and 'min'"):
1871 ax.set_zlim(bottom=0, zmin=1)
1872 with pytest.raises(
1873 TypeError, match="Cannot pass both 'upper' and 'max'"):
1874 ax.set_zlim(top=0, zmax=1)
1875
1876
1877@check_figures_equal()

Callers

nothing calls this directly

Calls 5

figureMethod · 0.80
add_subplotMethod · 0.80
allcloseMethod · 0.80
get_zlimMethod · 0.80
set_zlimMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…