Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scottshambaugh committed Dec 28, 2023
1 parent f57a96f commit 2c882d5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test_AxesStereo.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,38 @@ def test_AxesStereo2D_zlim():
assert len(axstereo.artists_right) == n_artists
assert len(axstereo.artist_args) == n_artists

def test_AxesAnaglyph_zlim():
x = y = z = np.arange(10)
axstereo = AxesAnaglyph()
axstereo.plot(x, y, z/2 + 1)
assert axstereo.zlim == (1, 5.5)

axstereo.plot(x, y, z)
assert axstereo.zlim == (0, 9)

axstereo.plot(x, y, z/2)
assert axstereo.zlim == (0, 9)

axstereo.set_zlim((0, 5), zautoscale=True)
assert axstereo.zlim == (0, 5)

axstereo.redraw() # we set autoscale=True, so redraw() should reset zlim
assert axstereo.zlim == (0, 9)

axstereo.set_zlim((0, 5), zautoscale=False)
axstereo.plot(x, y, z)
assert axstereo.zlim == (0, 5)

axstereo.plot(x, y, z, zlim=(1, 2))
assert axstereo.zlim == (1, 2)

assert axstereo.get_zlim() == (1, 2)

n_artists = 5 # from above plot()'s
assert len(axstereo.artists_left) == n_artists
assert len(axstereo.artists_right) == n_artists
assert len(axstereo.artist_args) == n_artists

def test_AxesStereo3D():
# Smoke test plotting
x, y, z = _testdata()['trefoil']
Expand Down

0 comments on commit 2c882d5

Please sign in to comment.