Add `norm` parameter to `streamplot`. #849

Merged
merged 3 commits into from Apr 30, 2012

2 participants

@tonysyu

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

Also, fixed/enhanced some docstrings.

@WeatherGod WeatherGod and 2 others commented on an outdated diff Apr 27, 2012
lib/matplotlib/streamplot.py
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
@WeatherGod
Matplotlib Developers member
WeatherGod added a line comment Apr 27, 2012

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?

@tonysyu
tonysyu added a line comment Apr 27, 2012

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?

@efiring
Matplotlib Developers member
efiring added a line comment Apr 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@WeatherGod
Matplotlib Developers member

Except for that one point, everything else looks good.

@tonysyu

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

@WeatherGod
Matplotlib Developers 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 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