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

Appearance settings

Commit 715fb43

Browse filesBrowse files
author
pelson
committed
Stylistic change.
1 parent f37729d commit 715fb43
Copy full SHA for 715fb43

File tree

Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed

‎lib/matplotlib/streamplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/streamplot.py
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
"""
55
import numpy as np
66
import matplotlib
7+
import matplotlib.cm as cm
8+
import matplotlib.colors as mcolors
9+
import matplotlib.collections as mcollections
710
import matplotlib.patches as patches
8-
from matplotlib.cm import get_cmap
911

1012
__all__ = ['streamplot']
1113

@@ -103,11 +105,11 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
103105

104106
if use_multicolor_lines:
105107
if norm is None:
106-
norm = matplotlib.colors.normalize(color.min(), color.max())
108+
norm = mcolors.normalize(color.min(), color.max())
107109
if cmap is None:
108-
cmap = get_cmap(matplotlib.rcParams['image.cmap'])
110+
cmap = cm.get_cmap(matplotlib.rcParams['image.cmap'])
109111
else:
110-
cmap = get_cmap(cmap)
112+
cmap = cm.get_cmap(cmap)
111113

112114
streamlines = []
113115
for t in trajectories:
@@ -139,7 +141,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
139141
p = patches.FancyArrowPatch(arrow_tail, arrow_head, **arrow_kw)
140142
axes.add_patch(p)
141143

142-
lc = matplotlib.collections.LineCollection(streamlines, **line_kw)
144+
lc = mcollections.LineCollection(streamlines, **line_kw)
143145
if use_multicolor_lines:
144146
lc.set_array(np.asarray(line_colors))
145147
lc.set_cmap(cmap)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.