Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a520f5

Browse files
Tests
1 parent 0ea64cd commit 2a520f5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@ def test_axes3d_repr():
6060
"title={'center': 'title'}, xlabel='x', ylabel='y', zlabel='z'>")
6161

6262

63+
@mpl3d_image_comparison(['axes3d_primary_views.png'])
64+
def test_axes3d_primary_views():
65+
# (view, (elev, azim, roll))
66+
views = [( 'XY', (90, -90, 0)),
67+
( 'XZ', (0, -90, 0)),
68+
( 'YZ', (0, 0, 0)),
69+
('-XY', (-90, 90, 0)),
70+
('-XZ', (0, 90, 0)),
71+
('-YZ', (0, 180, 0))]
72+
# When viewing primary planes, draw the two other axes on left and bottom
73+
fig, axs = plt.subplots(2, 3, subplot_kw={'projection': '3d'})
74+
for i, ax in enumerate([ax for ax_row in axs for ax in ax_row]):
75+
ax.set_title(views[i][0])
76+
ax.set_proj_type('ortho')
77+
ax.view_init(elev=views[i][1][0], azim=views[i][1][1], roll=views[i][1][2])
78+
plt.tight_layout()
79+
80+
6381
@mpl3d_image_comparison(['bar3d.png'])
6482
def test_bar3d():
6583
fig = plt.figure()

0 commit comments

Comments
 (0)