Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a78790b

Browse filesBrowse files
committed
TST: Modify the bar3d test to show three more angles
This shows the effect of #12138, where the two brightest faces are opposite each other.
1 parent f44b437 commit a78790b
Copy full SHA for a78790b

File tree

Expand file treeCollapse file tree

2 files changed

+10
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-3
lines changed
Loading

‎lib/mpl_toolkits/tests/test_mplot3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/tests/test_mplot3d.py
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,21 @@ def test_bar3d():
2727
extensions=['png']
2828
)
2929
def test_bar3d_shaded():
30-
fig = plt.figure()
31-
ax = fig.add_subplot(111, projection='3d')
3230
x = np.arange(4)
3331
y = np.arange(5)
3432
x2d, y2d = np.meshgrid(x, y)
3533
x2d, y2d = x2d.ravel(), y2d.ravel()
3634
z = x2d + y2d
37-
ax.bar3d(x2d, y2d, x2d * 0, 1, 1, z, shade=True)
35+
36+
views = [(-60, 30), (30, 30), (30, -30), (120, -30)]
37+
fig = plt.figure(figsize=plt.figaspect(1 / len(views)))
38+
axs = fig.subplots(
39+
1, len(views),
40+
subplot_kw=dict(projection='3d')
41+
)
42+
for ax, (azim, elev) in zip(axs, views):
43+
ax.bar3d(x2d, y2d, x2d * 0, 1, 1, z, shade=True)
44+
ax.view_init(azim=azim, elev=elev)
3845
fig.canvas.draw()
3946

4047

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.