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

Skip to content

Commit 66a640c

Browse files
Add test for minor grid functionality in 3D plots
1 parent 57fcc48 commit 66a640c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ def test_grid_off():
4949
ax = fig.add_subplot(projection='3d')
5050
ax.grid(False)
5151

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

5371
@mpl3d_image_comparison(['invisible_ticks_axis.png'], style='mpl20')
5472
def test_invisible_ticks_axis():

0 commit comments

Comments
 (0)