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

Skip to content

Commit 45cbc81

Browse files
author
Vlas Sokolov
committed
add an image comparison unit test for 3d errorbars
1 parent b86260a commit 45cbc81

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

examples/mplot3d/errorbar3d.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
t = np.arange(0, 2*np.pi+.1, 0.01)
1717
x, y, z = np.sin(t), np.cos(3*t), np.sin(5*t)
1818

19-
fig_zerr_kwargs = dict(zerr=0.2, capsize=2)
20-
fig_xerr_kwargs = dict(xerr=0.2, errorevery=(2, 2))
21-
2219
estep = 15
2320
zuplims = [True if (not i % estep and i // estep % 3 == 0)
2421
else False for i in range(t.size)]
60.1 KB
Loading

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,3 +916,21 @@ def test_minor_ticks():
916916
ax.set_yticklabels(["third"], minor=True)
917917
ax.set_zticks([0.50], minor=True)
918918
ax.set_zticklabels(["half"], minor=True)
919+
920+
921+
@mpl3d_image_comparison(['errorbar3d.png'], tol=0.03)
922+
def test_errorbar3d():
923+
t = np.arange(0, 2*np.pi+.1, 0.01)
924+
x, y, z = np.sin(t), np.cos(3*t), np.sin(5*t)
925+
926+
fig = plt.figure()
927+
ax = fig.gca(projection='3d')
928+
929+
estep = 15
930+
zuplims = [True if (not i % estep and i // estep % 3 == 0)
931+
else False for i in range(t.size)]
932+
zlolims = [True if (not i % estep and i // estep % 3 == 2)
933+
else False for i in range(t.size)]
934+
935+
ax.errorbar(x, y, z, 0.2, zuplims=zuplims, zlolims=zlolims,
936+
errorevery=estep)

0 commit comments

Comments
 (0)