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

Skip to content

Commit 2500b23

Browse files
committed
FIX: minor style change + add @cleanup
1 parent bad3406 commit 2500b23

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,10 +2284,14 @@ def handle_single_axis(scale, autoscaleon, shared_axes, interval,
22842284
# ignore non-finite data limits if good limits exist
22852285
finite_dl = [d for d in dl if np.isfinite(d).all()]
22862286
if len(finite_dl):
2287-
# if finite limits exist for atleast one axis (and the other is infinite), restore the
2288-
# finite limits
2289-
x_finite = [d for d in dl if (np.isfinite(d.intervalx).all() and (d not in finite_dl))]
2290-
y_finite = [d for d in dl if (np.isfinite(d.intervaly).all() and (d not in finite_dl))]
2287+
# if finite limits exist for atleast one axis (and the
2288+
# other is infinite), restore the finite limits
2289+
x_finite = [d for d in dl
2290+
if (np.isfinite(d.intervalx).all() and
2291+
(d not in finite_dl))]
2292+
y_finite = [d for d in dl
2293+
if (np.isfinite(d.intervaly).all() and
2294+
(d not in finite_dl))]
22912295

22922296
dl = finite_dl
22932297
dl.extend(x_finite)

lib/matplotlib/tests/test_axes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4901,6 +4901,7 @@ def test_minorticks_on():
49014901
ax.minorticks_on()
49024902

49034903

4904+
@cleanup
49044905
def test_twinx_knows_limits():
49054906
fig, ax = plt.subplots()
49064907

0 commit comments

Comments
 (0)