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

Skip to content

Commit ee070e3

Browse files
committed
TST: fix wrong minpos expectation in test_relim_collection
Line data [0, 1] x [0, 1] gives minpos=[1., 1.] (minimum *positive* value), not [inf, inf]. The [inf, inf] sentinel only appears when there are no positive values at all.
1 parent bfdb6c9 commit ee070e3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/tests/test_axes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6532,7 +6532,8 @@ def test_relim_collection():
65326532
ax.relim(visible_only=True)
65336533
# With scatter hidden, limits should be driven by the line only.
65346534
assert_allclose(ax.dataLim.get_points(), [[0, 0], [1, 1]])
6535-
assert_array_equal(ax.dataLim.minpos, [np.inf, np.inf])
6535+
# minpos is the minimum *positive* value; line data [0, 1] gives 1.0.
6536+
assert_array_equal(ax.dataLim.minpos, [1., 1.])
65366537

65376538

65386539
def test_relim_collection_autolim_false():

0 commit comments

Comments
 (0)