Skip to content

Commit 9f38fd6

Browse files
committed
TST: add test for finite bbox on logit
1 parent a420913 commit 9f38fd6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/tests/test_scale.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ def test_log_scales():
1717
@image_comparison(baseline_images=['logit_scales'], remove_text=True,
1818
extensions=['png'])
1919
def test_logit_scales():
20-
ax = plt.figure().add_subplot(111, xscale='logit')
20+
fig, ax = plt.subplots()
2121

2222
# Typical extinction curve for logit
2323
x = np.array([0.001, 0.003, 0.01, 0.03, 0.1, 0.2, 0.3, 0.4, 0.5,
2424
0.6, 0.7, 0.8, 0.9, 0.97, 0.99, 0.997, 0.999])
2525
y = 1.0 / x
2626

2727
ax.plot(x, y)
28+
ax.set_xscale('logit')
2829
ax.grid(True)
29-
30+
bbox = ax.get_tightbbox(fig.canvas.get_renderer())
31+
assert np.isfinite(bbox.x0)
32+
assert np.isfinite(bbox.y0)
3033

3134
def test_log_scatter():
3235
"""Issue #1799"""

0 commit comments

Comments
 (0)