Skip to content

Commit 7e820b7

Browse files
committed
Add test for surface plot with inf values
1 parent 879793e commit 7e820b7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
87.3 KB
Loading

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,3 +2232,16 @@ def test_scatter_masked_color():
22322232
# Assert sizes' equality
22332233
assert len(path3d.get_offsets()) ==\
22342234
len(super(type(path3d), path3d).get_facecolors())
2235+
2236+
2237+
@mpl3d_image_comparison(['surface3d_zsort_inf.png'], style='mpl20')
2238+
def test_surface3d_zsort_inf():
2239+
fig = plt.figure()
2240+
ax = fig.add_subplot(projection='3d')
2241+
2242+
x, y = np.mgrid[-2:2:0.1,-2:2:0.1]
2243+
z = np.sin(x)**2 + np.cos(y)**2
2244+
z[x.shape[0] // 2:, x.shape[1] // 2:] = np.inf
2245+
2246+
ax.plot_surface(x, y, z, cmap='jet')
2247+
ax.view_init(elev=45, azim=145)

0 commit comments

Comments
 (0)