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 4a3df94

Browse filesBrowse files
committed
Simplify test
1 parent 6640e60 commit 4a3df94
Copy full SHA for 4a3df94

File tree

Expand file treeCollapse file tree

1 file changed

+13
-22
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-22
lines changed

‎lib/matplotlib/tests/test_ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_ticker.py
+13-22Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import matplotlib.pyplot as plt
1313
import matplotlib.ticker as mticker
1414

15-
import random
16-
1715

1816
class TestMaxNLocator:
1917
basic_data = [
@@ -1806,23 +1804,16 @@ def test_minorticks_on_multi_fig():
18061804
that contains more than one boxplot and shares the x-axis
18071805
should not raise an exception.
18081806
"""
1809-
fig, ax = plt.subplots(sharex=True, ncols=2, nrows=2)
1810-
1811-
def values():
1812-
return [random.random() for _ in range(9)]
1813-
1814-
for x in range(3):
1815-
ax[0, 0].boxplot(values(), positions=[x])
1816-
ax[0, 1].boxplot(values(), positions=[x])
1817-
ax[1, 0].boxplot(values(), positions=[x])
1818-
ax[1, 1].boxplot(values(), positions=[x])
1819-
1820-
for a in ax.flatten():
1821-
a.grid(which="major")
1822-
a.grid(which="minor", linestyle="--")
1823-
a.minorticks_on()
1824-
fig.canvas.draw()
1825-
1826-
assert all(a.get_xgridlines() for a in ax.flatten())
1827-
assert all((isinstance(a.xaxis.get_minor_locator(), mpl.ticker.AutoMinorLocator)
1828-
for a in ax.flatten()))
1807+
fig, ax = plt.subplots()
1808+
1809+
ax.boxplot(np.arange(10), positions=[0])
1810+
ax.boxplot(np.arange(10), positions=[0])
1811+
ax.boxplot(np.arange(10), positions=[1])
1812+
1813+
ax.grid(which="major")
1814+
ax.grid(which="minor")
1815+
ax.minorticks_on()
1816+
fig.draw_without_rendering()
1817+
1818+
assert ax.get_xgridlines()
1819+
assert isinstance(ax.xaxis.get_minor_locator(), mpl.ticker.AutoMinorLocator)

0 commit comments

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