Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Avoid quadratic behavior when accumulating stickies.#12546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2405,12 +2405,12 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True): | ||
if self.use_sticky_edges and (self._xmargin or self._ymargin): | ||
stickies = [artist.sticky_edges for artist in self.get_children()] | ||
x_stickies =np.array([x for sticky in stickies for x in sticky.x]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. np.isclose is called just below anyways so converting to array here vs just below shouldn't affect performance. | ||
y_stickies =np.array([y for sticky in stickies for y in sticky.y]) | ||
if self.get_xscale().lower() == 'log': | ||
x_stickies =x_stickies[x_stickies > 0] | ||
if self.get_yscale().lower() == 'log': | ||
y_stickies =y_stickies[y_stickies > 0] | ||
else: # Small optimization. | ||
x_stickies, y_stickies = [], [] | ||