MCPcopy
hub / github.com/matplotlib/matplotlib / test_bar3d_shaded

Function test_bar3d_shaded

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

Source from the content-addressed store, hash-verified

164
165@mpl3d_image_comparison(['bar3d_shaded.png'], style='mpl20')
166def test_bar3d_shaded():
167 x = np.arange(4)
168 y = np.arange(5)
169 x2d, y2d = np.meshgrid(x, y)
170 x2d, y2d = x2d.ravel(), y2d.ravel()
171 z = x2d + y2d + 1 # Avoid triggering bug with zero-depth boxes.
172
173 views = [(30, -60, 0), (30, 30, 30), (-30, 30, -90), (300, -30, 0)]
174 fig = plt.figure(figsize=plt.figaspect(1 / len(views)))
175 axs = fig.subplots(
176 1, len(views),
177 subplot_kw=dict(projection='3d')
178 )
179 for ax, (elev, azim, roll) in zip(axs, views):
180 ax.bar3d(x2d, y2d, x2d * 0, 1, 1, z, shade=True)
181 ax.view_init(elev=elev, azim=azim, roll=roll)
182 fig.canvas.draw()
183
184
185@mpl3d_image_comparison(['bar3d_notshaded.png'], style='mpl20',

Callers

nothing calls this directly

Calls 5

figureMethod · 0.80
bar3dMethod · 0.80
view_initMethod · 0.80
subplotsMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…