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 d6d43e9

Browse filesBrowse files
committed
TST: Add a test of bar3d from two more angles
This shows somewhat corrected shading. although there still seem to be double-drawing bugs.
1 parent 8c6a52a commit d6d43e9
Copy full SHA for d6d43e9

File tree

Expand file treeCollapse file tree

4 files changed

+15
-2
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+15
-2
lines changed
Loading
Loading

‎lib/mpl_toolkits/tests/test_mplot3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/tests/test_mplot3d.py
+15-2Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@
99
import numpy as np
1010

1111

12+
@pytest.fixture
13+
def baseline_images(request, extension):
14+
# strip the leading test_, and the file extension from the parameters
15+
name = request.node.name
16+
if name.startswith('test_'):
17+
name = name[5:]
18+
name = name.replace('[{}-'.format(extension), '[')
19+
name = name.replace('[]', '')
20+
return [name]
21+
22+
1223
@image_comparison(baseline_images=['bar3d'], remove_text=True)
1324
def test_bar3d():
1425
fig = plt.figure()
@@ -21,12 +32,13 @@ def test_bar3d():
2132
ax.bar(xs, ys, zs=z, zdir='y', align='edge', color=cs, alpha=0.8)
2233

2334

35+
@pytest.mark.parametrize('azim, elev', [(-60, 30), (-120, 30), (120, -30)])
2436
@image_comparison(
25-
baseline_images=['bar3d_shaded'],
37+
baseline_images=None,
2638
remove_text=True,
2739
extensions=['png']
2840
)
29-
def test_bar3d_shaded():
41+
def test_bar3d_shaded(baseline_images, azim, elev):
3042
fig = plt.figure()
3143
ax = fig.add_subplot(111, projection='3d')
3244
x = np.arange(4)
@@ -35,6 +47,7 @@ def test_bar3d_shaded():
3547
x2d, y2d = x2d.ravel(), y2d.ravel()
3648
z = x2d + y2d
3749
ax.bar3d(x2d, y2d, x2d * 0, 1, 1, z, shade=True)
50+
ax.view_init(azim=azim, elev=elev)
3851
fig.canvas.draw()
3952

4053

0 commit comments

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