Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 715fb43

Browse files
author
pelson
committed
Stylistic change.
1 parent f37729d commit 715fb43

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/matplotlib/streamplot.py

Lines 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)