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

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

Merged
jklymak merged 1 commit intomatplotlib:masterfromanntzer:quadratic-stickies
Oct 17, 2018
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletionslib/matplotlib/axes/_base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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 =sum([sticky.x for sticky in stickies], [])
y_stickies =sum([sticky.y for sticky in stickies], [])
x_stickies =np.array([x for sticky in stickies for x in sticky.x])
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The 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 =[xs for xs inx_stickies if xs > 0]
x_stickies =x_stickies[x_stickies > 0]
if self.get_yscale().lower() == 'log':
y_stickies =[ys for ys iny_stickies if ys > 0]
y_stickies =y_stickies[y_stickies > 0]
else: # Small optimization.
x_stickies, y_stickies = [], []

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp