8000 TST: add test for finite bbox on logit · matplotlib/matplotlib@e213f4b · GitHub
[go: up one dir, main page]

Skip to content
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 e213f4b

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/tests/test_scale.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +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)
30+
bbox = ax.get_tightbbox(fig.canvas.get_renderer())
31+
assert np.isfinite(bbox.x0)
32+
assert np.isfinite(bbox.y0)
2933

3034

3135
def test_log_scatter():

0 commit comments

Comments
 (0)
0