Skip to content
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

Fix streamplot when color argument has NaNs #1514

Merged
merged 3 commits into from Dec 2, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/matplotlib/__init__.py
Expand Up @@ -1105,6 +1105,7 @@ def tk_window_focus():
'matplotlib.tests.test_scale',
'matplotlib.tests.test_simplification',
'matplotlib.tests.test_spines',
'matplotlib.tests.test_streamplot',
'matplotlib.tests.test_subplots',
'matplotlib.tests.test_text',
'matplotlib.tests.test_ticker',
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/streamplot.py
Expand Up @@ -82,6 +82,8 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
if use_multicolor_lines:
assert color.shape == grid.shape
line_colors = []
if np.any(np.isnan(color)):
color = np.ma.array(color, mask=np.isnan(color))
else:
line_kw['color'] = color
arrow_kw['color'] = color
Expand Down
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.