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

Skip to content

Commit 0c1e609

Browse files
committed
Fix some typos and handle some other codes using color cycling
1 parent 6b2223d commit 0c1e609

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,7 @@ def xywhere(xs, ys, mask):
29362936

29372937
if ecolor is None:
29382938
if l0 is None and 'color' in self._get_lines._prop_keys:
2939-
ecolor = six.next(self._get_lines.prop_cycle)['color']
2939+
ecolor = six.next(self._get_lines.prop_cycler)['color']
29402940
else:
29412941
ecolor = l0.get_color()
29422942

@@ -5830,7 +5830,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
58305830
nx = len(x) # number of datasets
58315831

58325832
if color is None and 'color' in self._get_lines._prop_keys:
5833-
color = [six.next(self._get_lines.prop_cycle)['color']
5833+
color = [six.next(self._get_lines.prop_cycler)['color']
58345834
for i in xrange(nx)]
58355835
else:
58365836
color = mcolors.colorConverter.to_rgba_array(color)

lib/matplotlib/pyplot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import warnings
2525
import types
2626

27+
from cycler import cycler
2728
import matplotlib
2829
import matplotlib.colorbar
2930
from matplotlib import style
@@ -394,7 +395,7 @@ def xkcd(scale=1, length=100, randomness=2):
394395
rcParams['grid.linewidth'] = 0.0
395396
rcParams['axes.grid'] = False
396397
rcParams['axes.unicode_minus'] = False
397-
rcParams['axes.color_cycle'] = ['b', 'r', 'c', 'm']
398+
rcParams['axes.prop_cycle'] = cycler('color', ['b', 'r', 'c', 'm'])
398399
rcParams['axes.edgecolor'] = 'black'
399400
rcParams['xtick.major.size'] = 8
400401
rcParams['xtick.major.width'] = 3

lib/matplotlib/stackplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ def stackplot(axes, x, *args, **kwargs):
103103

104104
# Color between x = 0 and the first array.
105105
r.append(axes.fill_between(x, first_line, stack[0, :],
106-
facecolor=six.next(axes._get_lines.color_cycle),
106+
facecolor=six.next(axes._get_lines.prop_cycler)['color'],
107107
label= six.next(labels, None),
108108
**kwargs))
109109

110110
# Color between array i-1 and array i
111111
for i in xrange(len(y) - 1):
112-
color = six.next(axes._get_lines.color_cycle)
112+
color = six.next(axes._get_lines.prop_cycler)['color']
113113
r.append(axes.fill_between(x, stack[i, :], stack[i + 1, :],
114114
facecolor= color,
115115
label= six.next(labels, None),

lib/matplotlib/streamplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
8383
transform = axes.transData
8484

8585
if color is None:
86-
color = six.next(axes._get_lines.color_cycle)
86+
color = six.next(axes._get_lines.prop_cycler)['color']
8787

8888
if linewidth is None:
8989
linewidth = matplotlib.rcParams['lines.linewidth']

0 commit comments

Comments
 (0)