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

Artist autolim#28071

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

Closed
jayyxiao wants to merge2 commits intomatplotlib:mainfromjayyxiao:artist-autolim
Closed

Conversation

@jayyxiao
Copy link

@jayyxiaojayyxiao commentedApr 13, 2024
edited
Loading

PR summary

Move auto-limit logic inside respective Artists

This will allow forrelim to work withCollections.closes#25139 .

_update_*_limits() were moved inside respective Artists. An_in_autoscale flag was created in base Artist, with setters and getters. This flag can be a bool or tuple, as specified in#15595 . Also,_update_limits() was created inCollection. Thus,relim checks the_in_autoscale flag and calls a generic_update_limits(), which now exists inCollection.

_in_autoscale is set to True in the Artist constructor. Expansion to a tuple will be done by the setter._in_autoscale can be set to False when theautolim parameter ofadd_collection is False.

Since I am a new contributor, I hope this can be a starting point. I'm just looking for some feedback.

PR checklist

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

@tacaswell
Copy link
Member

@jayyxiao I'm sorry this got no attention when you opened this (I have been super busy the last month and know some of the other core developers are in a similar situation). I assure you our lack of response is in no way commentary on your work!

Giving it a quick skim this seems like it is heading the right direction, however I have one concern. Passing theAxes object into an artist method which then "returns" the results by mutating its parent is a bit odd. I think it would be better if the return from_update_limits was made uniform so the loop over children would look something like:

forartistinself.children:ifnotvisible_onlyor (artist.get_visible()andartist.get_in_autoscale()):limits,to_update=artist._get_limits(self.transData)self.update_datalim(limits,**to_update)

Put another way, currently we have too much artist-specific stuff in Axes, but this swings too far the other way and puts too much Axes specific stuff into the Artists.

Additionally, being able to get the data limits of an artist is useful for other things (maybe cheaper hit-checking for picker, improving the auto-placement of the legend, etc) so being able to get at this might be useful.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[ENH]: generalize artists opting in-to auto limits

2 participants

@jayyxiao@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp