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

Function test_surface3d

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

Source from the content-addressed store, hash-verified

643
644@mpl3d_image_comparison(['surface3d.png'], style='mpl20')
645def test_surface3d():
646 # Remove this line when this test image is regenerated.
647 plt.rcParams['pcolormesh.snap'] = False
648
649 fig = plt.figure()
650 ax = fig.add_subplot(projection='3d')
651 X = np.arange(-5, 5, 0.25)
652 Y = np.arange(-5, 5, 0.25)
653 X, Y = np.meshgrid(X, Y)
654 R = np.hypot(X, Y)
655 Z = np.sin(R)
656 surf = ax.plot_surface(X, Y, Z, rcount=40, ccount=40, cmap="coolwarm",
657 lw=0, antialiased=False)
658 plt.rcParams['axes3d.automargin'] = True # Remove when image is regenerated
659 ax.set_zlim(-1.01, 1.01)
660 fig.colorbar(surf, shrink=0.5, aspect=5)
661
662
663@image_comparison(['surface3d_label_offset_tick_position.png'], style='mpl20')

Callers

nothing calls this directly

Calls 5

figureMethod · 0.80
add_subplotMethod · 0.80
plot_surfaceMethod · 0.80
set_zlimMethod · 0.80
colorbarMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…