Skip to content

Add norm parameter to streamplot. #849

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 30, 2012

Conversation

tonysyu
Copy link
Contributor

@tonysyu tonysyu commented Apr 22, 2012

As suggested by @efiring: "when a cmap kwarg is allowed, a norm kwarg should also be allowed."

Also, fixed/enhanced some docstrings.

Line collection with all streamlines as a series of line segments.
Currently, there is no way to differentiate between line segments
on different streamlines (other than manually checking that segments
are connected).
are connected). NOTE: this return value is likely to change since it
Copy link
Member

Choose a reason for hiding this comment

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

Why not prepare for future changes by simply returning a one-element list? Future revisions could then have the arrow patches as the next item in the list without breaking anyone existing code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not actually sure what the future return value will look like. A two-item list sounds a bit like what I implemented in PR #803, but @efiring suggested a different approach---possibly using the Container class. Based on the subclasses in matplotlib.container, it seems a Container-based return value may look (to the user) like a one-element tuple. Is that correct?

Copy link
Member

Choose a reason for hiding this comment

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

On Fri, Apr 27, 2012 at 1:42 PM, Benjamin Root
reply@reply.github.com
wrote:

         Line collection with all streamlines as a series of line segments.
         Currently, there is no way to differentiate between line segments
         on different streamlines (other than manually checking that segments

  •        are connected).
  •        are connected). NOTE: this return value is likely to change since it

Why not prepare for future changes by simply returning a one-element list?  Future revisions could then have the arrow patches as the next item in the list without breaking anyone existing code?

Because I don't think a list is the way to go for complex objects like
this. Better to return an instance of a class.

Eric


Reply to this email directly or view it on GitHub:
https://github.com/matplotlib/matplotlib/pull/849/files#r744390

@WeatherGod
Copy link
Member

Except for that one point, everything else looks good.

@tonysyu
Copy link
Contributor Author

tonysyu commented Apr 28, 2012

I just removed the note about the return value of streamplot, and I'll try to address that issue in PR #803.

@WeatherGod
Copy link
Member

I think that is much better. It is a good rule of thumb to keep PR's focused on a single issue at a time. I say this is ready to be pulled in.

WeatherGod added a commit that referenced this pull request Apr 30, 2012
Add `norm` parameter to `streamplot`.
@WeatherGod WeatherGod merged commit 342c028 into matplotlib:master Apr 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants