E5E7 Add `streamplot` axes method to plot streamlines by tonysyu · Pull Request #664 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
687af18
Add `streamplot` axes method to plot streamlines
tonysyu Jan 8, 2012
0657e73
Add improvements from Tom Flannaghan.
tonysyu Jan 10, 2012
a88f621
Fix bounds checking.
tonysyu Jan 10, 2012
28a9e27
Remove `Terminated` exception.
tonysyu Jan 10, 2012
e6e977a
Remove OutOfBounds exception and factor out Euler step
tonysyu Jan 10, 2012
3bf9f09
Move comments into docstring.
tonysyu Jan 11, 2012
3144f6d
Adjust exponent of step-size correction to match method-order.
tonysyu Jan 11, 2012
5632418
Fix error raised when trajectory lands on Nx or Ny.
tonysyu Jan 11, 2012
d60c9fc
Remove integrator parameter for streamplot
tonysyu Jan 11, 2012
6f3053e
Add streamplot function to pyplot.
tonysyu Jan 16, 2012
72abc5d
Fix streamplot to work with colorbar.
tonysyu Jan 17, 2012
b884fc8
Fix selection of arrow's linewidth and color
tonysyu Jan 17, 2012
7d01052
Add support for masked arrays.
tonysyu Jan 17, 2012
40dce9c
Change handling of masked arrays.
tonysyu Jan 17, 2012
07553f0
Remove copyright notice.
tonysyu Jan 18, 2012
3259d0a
Return collection of streamlines from `streamplot`.
tonysyu Jan 19, 2012
a98c543
Add example to plot streamplot with masked values.
tonysyu Jan 19, 2012
ed29d17
Fix issues raised by PhilipElson in PR #664.
tonysyu Feb 7, 2012
398e8ec
Rename `valid_index` to `within_grid`.
tonysyu Feb 8, 2012
8152811
Change type checks to calls to isinstance.
tonysyu Feb 22, 2012
9c51448
Set default color and linewidth to None and use rc defaults.
tonysyu Feb 22, 2012
b77effe
Change streamplot to default to color in color_cycle.
tonysyu Feb 22, 2012
6ca72da
Address JDH's PR comments
tonysyu Feb 27, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix bounds checking.
Checking that the coordinate less than the array Nx/Ny does not work when the coordinate is float (e.g. it can be between `Nx` and `Nx - 1`).
  • Loading branch information
tonysyu committed Jan 10, 2012
commit a88f621b7a186447a3cd3030798f06b56a17a2e2
2 changes: 1 addition & 1 deletion lib/matplotlib/streamplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def shape(self):

def valid_index(self, xi, yi):
"""Return True if point is a valid index of grid."""
return xi >= 0 and xi < self.nx and yi >= 0 and yi < self.ny
return xi >= 0 and xi <= self.nx-1 and yi >= 0 and yi <= self.ny-1
Copy link
Member

Choose a reason for hiding this comment

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

Think this could be simplified to 0 <= xi <= self.nx - 1 and 0 <= yi <= self.ny - 1.

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 thought the same thing, but since xi and yi can be float values, xi and yi can be larger the nx-1 and ny-1 but less than nx and ny. I think the use of this function changed at some point so the name valid_index is misleading (since an index should be an integer). I'll probably change this in a future commit.



class StreamMask(object):
Expand Down
0