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

Skip to content

Commit 507de28

Browse files
committed
TST: Add test for minor grid in Axes3D
1 parent 57fcc48 commit 507de28

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,25 @@ def test_grid_off():
5050
ax.grid(False)
5151

5252

53+
def test_minor_grid_3d():
54+
fig = plt.figure()
55+
ax = fig.add_subplot(111, projection='3d')
56+
ax.scatter([1, 2, 3], [1, 2, 3], [1, 2, 3])
57+
58+
# Minor grid off by default
59+
assert not ax._draw_minor_grid
60+
61+
# Enabling sets the flag and stores kwargs
62+
ax.grid(which='minor', color='lightgrey', linewidth=0.3)
63+
assert ax._draw_minor_grid
64+
assert ax._minor_grid_kwargs['linewidth'] == 0.3
65+
66+
# Major grid unaffected
67+
assert ax._draw_grid
68+
69+
plt.close(fig)
70+
71+
5372
@mpl3d_image_comparison(['invisible_ticks_axis.png'], style='mpl20')
5473
def test_invisible_ticks_axis():
5574
fig = plt.figure()

0 commit comments

Comments
 (0)