Skip to content

Commit 1ae9888

Browse files
committed
Add test ax.set_yticks for math.round issue of np.inf
1 parent c287b9f commit 1ae9888

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/tests/test_ticker.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,6 +1774,10 @@ def test_small_range_loglocator(numticks):
17741774
ticks = ll.tick_values(.5, top)
17751775
assert (np.diff(np.log10(ll.tick_values(6, 150))) == 1).all()
17761776

1777+
def test_yticks_with_inf():
1778+
fig, ax = plt.subplots()
1779+
ax.loglog(np.logspace(0, 10, 10), np.logspace(0, 10, 10)**2)
1780+
ax.set_yticks([1, 10, np.inf])
17771781

17781782
def test_NullFormatter():
17791783
formatter = mticker.NullFormatter()

0 commit comments

Comments
 (0)