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

Changed the return type of streamplot to a container object#24388

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

Draft
story645 wants to merge2 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromstory645:streamcontainer

Conversation

story645
Copy link
Member

@story645story645 commentedNov 7, 2022
edited
Loading

The idea of using a container object for streamplots was discussed in#803, but they settled on basically a lightweight datatype object. My reasoning for switching to a container was a combo of container providing a nicerrepl (kind of) and so that there would be more uniformity around artist return types cause the docs can all point to.Container

I'm sort of concerned that no tests seem to fail given the discussion in the original PR is that containers don't play well with scalar mappables, but that could be due to changes in how container was implemented?

This came up cause of the discussion in#24274 around good examples forArtistAnimation being the artists that return containers or contourset. Looking at contourset, that seemed very specialized and like it made more sense to think of this like the containers and maybe build out to support some of the other things mentioned in the note for this method.

The actual change is super lightweight since it's switching one named tuple for the other, which means anyone currently relying on a StreamplotSet object doesn't lose thelines orarrows attribute.

It seemed easiest to weave this in is by

  1. deprecatingStreamplotSet
  2. addingStreamplotContainer

I didn't write up a whats new or api_change 'cause I know this needs to be discussed first.

Eta:@efiring what sorta information did you want this container to hold?

Deprecated StreamplotSetAdded StreamplotContainer
@story645story645 marked this pull request as draftNovember 7, 2022 04:23
@story645
Copy link
MemberAuthor

story645 commentedNov 11, 2022
edited
Loading

Discussed on call and .remove doesn't work b/c there's no remove method on collections, b/c that is apparently a hard problem,

# TODO: the fix for the collections relim problem is to move the
# limits calculation into the artist itself, including the property of
# whether or not the artist should affect the limits. Then there will
# be no distinction between axes.add_line, axes.add_patch, etc.
# TODO: add legend support

one that I think requires writing an iterator for collections, so uh putting this as a note for when I get back to this...

ETA: Container should possibly be a dataclass instead of inheriting from tuple if the main reason it's inheriting from tuple is the named attributes.

@anntzer
Copy link
Contributor

anntzer commentedFeb 2, 2023
edited
Loading

On a tangentially related point, I wonder whether we can stop using FancyArrowPatches (which are relatively complex) to draw the arrowheads in the streamplot (note that we don't even use them to draw arrow bodies...), and instead simply use markers with the appropriate rotation? (It would still have to be a PathCollection to support colormapping, but not a PatchCollection.)
Edit: Actually perhaps not, a nice thing about FancyArrowPatch it that it provides data-coordinates rotation for free.

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

Successfully merging this pull request may close these issues.

2 participants
@story645@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp