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

Skip to content

Commit 40b7837

Browse files
committed
Merge pull request #5605 from sjpfenninger/stackplot-cycler
Fix DeprecationWarning in stackplot.py
2 parents 9a7dfd7 + d9954e0 commit 40b7837

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/stackplot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from matplotlib.externals import six
1313
from matplotlib.externals.six.moves import xrange
1414

15+
from cycler import cycler
1516
import numpy as np
1617

1718
__all__ = ['stackplot']
@@ -63,7 +64,7 @@ def stackplot(axes, x, *args, **kwargs):
6364

6465
colors = kwargs.pop('colors', None)
6566
if colors is not None:
66-
axes.set_color_cycle(colors)
67+
axes.set_prop_cycle(cycler('color', colors))
6768

6869
baseline = kwargs.pop('baseline', 'zero')
6970
# Assume data passed has not been 'stacked', so stack it here.

0 commit comments

Comments
 (0)