Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

Sign up
Appearance settings

Commitd834b01

Browse files
committed
Only propagate minpos if it's been set.
This is mostly for the sake of third-party `Collection` subclasses thatmight have overridden `get_datalim`.
1 parentf9978ab commitd834b01

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

‎lib/matplotlib/axes/_base.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,12 +1991,15 @@ def add_collection(self, collection, autolim=True):
19911991
# pre-lazy-autoscale behavior, which is not really better).
19921992
self._unstale_viewLim()
19931993
datalim=collection.get_datalim(self.transData)
1994-
# By definition, p0 <= minpos <= p1, so minpos would be
1995-
# unnecessary. However, we add minpos to the call so that
1996-
# self.dataLim will update its own minpos. This ensures that log
1997-
# scales see the correct minimum.
1998-
self.update_datalim(
1999-
np.row_stack([datalim.p0,datalim.minpos,datalim.p1]))
1994+
points=datalim.get_points()
1995+
ifnotnp.isinf(datalim.minpos).all():
1996+
# By definition, if minpos (minimum positive value) is set
1997+
# (i.e., non-inf), then min(points) <= minpos <= max(points),
1998+
# and minpos would be superfluous. However, we add minpos to
1999+
# the call so that self.dataLim will update its own minpos.
2000+
# This ensures that log scales see the correct minimum.
2001+
points=np.concatenate([points, [datalim.minpos]])
2002+
self.update_datalim(points)
20002003

20012004
self.stale=True
20022005
returncollection

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp