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

Use autolim kwarg in add_collection to prevent duplication of effort.#3100

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
tacaswell merged 1 commit intomatplotlib:masterfromefiring:set_autolim
Jun 2, 2014

Conversation

efiring
Copy link
Member

This changeset cleans up several problems associated with updating
Axes.dataLim. The basic point is that when a method that creates
a collection also updates Axes.dataLim, Axes.add_collection() should be
called with autolim=False. With autolim=True, add_collection will
use a very general method to update the dataLim, but in many cases
the method creating the collection can perform the update much more
efficiently.

Closes#3095, which reported a regression that appears to have been
introduced by88b722f.

This changeset cleans up several problems associated with updatingAxes.dataLim. The basic point is that when a method that createsa collection also updates Axes.dataLim, Axes.add_collection() should becalled with autolim=False.  With autolim=True, add_collection willuse a very general method to update the dataLim, but in many casesthe method creating the collection can perform the update much moreefficiently.Closesmatplotlib#3095, which reported a regression that appears to have beenintroduced by88b722f.
@@ -4301,9 +4301,10 @@ def get_interp_point(ind):
XY2 = np.array([x[where], y2[where]]).T
self.dataLim.update_from_data_xy(XY1, self.ignore_existing_data_limits,
updatex=True, updatey=True)
self.ignore_existing_data_limits = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why did this get added?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This flag is initialized to True bycla(); subsequently, anything that updates the dataLim needs to set it to False so that the updating is cumulative rather than starting again from scratch.

@tacaswelltacaswell added this to thev1.4.0 milestoneJun 1, 2014
tacaswell added a commit that referenced this pull requestJun 2, 2014
Use autolim kwarg in add_collection to prevent duplication of effort.
@tacaswelltacaswell merged commit62bae67 intomatplotlib:masterJun 2, 2014
@@ -5032,7 +5033,7 @@ def pcolormesh(self, *args, **kwargs):
corners = (minx, miny), (maxx, maxy)
self.update_datalim(corners)
self.autoscale_view()
self.add_collection(collection)
self.add_collection(collection, autolim=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think the better solution (but not the quicker solution, so I'm happy this PR was merged) would be to implement an appropriate data limit updater on the QuadMeshCollection - I'm not sure I'll get around to doing this anytime soon, so just wanted to post it here as a reminder.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v1.4.0
Development

Successfully merging this pull request may close these issues.

Memory issue when plotting large arrays with pcolormesh
4 participants
@efiring@tacaswell@pelson@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp