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

Skip to content

Commit 318a589

Browse files
committed
Disable sticky edge accumulation if no autoscaling.
If there's no margin to be added, we don't need sticky edges, but if autoscaling is off, we _also_ don't need the sticky edges. This saves a lot of time when plotting many artists, like in #12542.
1 parent 97a580c commit 318a589

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2403,7 +2403,9 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
24032403
if tight is not None:
24042404
self._tight = bool(tight)
24052405

2406-
if self.use_sticky_edges and (self._xmargin or self._ymargin):
2406+
if self.use_sticky_edges and (
2407+
(self._xmargin and scalex and self._autoscaleXon) or
2408+
(self._ymargin and scaley and self._autoscaleYon)):
24072409
stickies = [artist.sticky_edges for artist in self.get_children()]
24082410
x_stickies = sum([sticky.x for sticky in stickies], [])
24092411
y_stickies = sum([sticky.y for sticky in stickies], [])

0 commit comments

Comments
 (0)