|
| 1 | +import sys |
| 2 | +import nose |
| 3 | +from nose.tools import assert_raises |
1 | 4 | from mpl_toolkits.mplot3d import Axes3D, axes3d |
2 | 5 | from matplotlib import cm |
3 | | -from matplotlib.testing.decorators import image_comparison |
| 6 | +from matplotlib.testing.decorators import image_comparison, cleanup |
4 | 7 | import matplotlib.pyplot as plt |
5 | 8 | import numpy as np |
6 | 9 |
|
@@ -172,6 +175,34 @@ def test_wireframe3d(): |
172 | 175 | ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10) |
173 | 176 |
|
174 | 177 |
|
| 178 | +@image_comparison(baseline_images=['wireframe3dzerocstride'], remove_text=True, |
| 179 | + extensions=['png']) |
| 180 | +def test_wireframe3dzerocstride(): |
| 181 | + fig = plt.figure() |
| 182 | + ax = fig.add_subplot(111, projection='3d') |
| 183 | + X, Y, Z = axes3d.get_test_data(0.05) |
| 184 | + ax.plot_wireframe(X, Y, Z, rstride=10, cstride=0) |
| 185 | + |
| 186 | + |
| 187 | +@image_comparison(baseline_images=['wireframe3dzerorstride'], remove_text=True, |
| 188 | + extensions=['png']) |
| 189 | +def test_wireframe3dzerorstride(): |
| 190 | + fig = plt.figure() |
| 191 | + ax = fig.add_subplot(111, projection='3d') |
| 192 | + X, Y, Z = axes3d.get_test_data(0.05) |
| 193 | + ax.plot_wireframe(X, Y, Z, rstride=0, cstride=10) |
| 194 | + |
| 195 | +@cleanup |
| 196 | +def test_wireframe3dzerostrideraises(): |
| 197 | + if sys.version_info[:2] < (2, 7): |
| 198 | + raise nose.SkipTest("assert_raises as context manager " |
| 199 | + "not supported with Python < 2.7") |
| 200 | + fig = plt.figure() |
| 201 | + ax = fig.add_subplot(111, projection='3d') |
| 202 | + X, Y, Z = axes3d.get_test_data(0.05) |
| 203 | + with assert_raises(ValueError): |
| 204 | + ax.plot_wireframe(X, Y, Z, rstride=0, cstride=0) |
| 205 | + |
175 | 206 | @image_comparison(baseline_images=['quiver3d'], remove_text=True) |
176 | 207 | def test_quiver3d(): |
177 | 208 | fig = plt.figure() |
|
0 commit comments