Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 0d725ee9 authored by Matthieu Tristram's avatar Matthieu Tristram
Browse files

Update color_cycle for matplotlib >= 1.5

parent 533f81d2
......@@ -399,9 +399,10 @@ def posterior1d( chains, params, nbin=50, smooth=1,
fig=plt.figure(figsize=figsize)
if len(colors) < nchain:
ax = plt.gca()
color_cycle = ax._get_lines.color_cycle
colors = [next(color_cycle) for i in range(nchain)]
# ax = plt.gca()
# color_cycle = ax._get_lines.prop_cycler #ax._get_lines.color_cycle
# colors = [next(color_cycle) for i in range(nchain)]
colors = rcParams['axes.color_cycle']
if len(linestyles) < nchain:
linestyles = ['-']*nchain
......@@ -564,9 +565,10 @@ def triangle( chains, params, nbin=50, parnames=None, names=[], colors=[], lines
npar = len(params)
if len(colors) < nchain:
ax = plt.gca()
color_cycle = ax._get_lines.color_cycle
colors = [next(color_cycle) for i in range(nchain)]
# ax = plt.gca()
# color_cycle = ax._get_lines.prop_cycler #ax._get_lines.color_cycle
# colors = [next(color_cycle) for i in range(nchain)]
colors = rcParams['axes.color_cycle']
if len(cmaps) < nchain:
cmaps = ['Blues','Greens','Greys','Oranges','Purples']
......@@ -1626,7 +1628,13 @@ class prof:
all plot arguments
"""
ax = plt.gca()
color = kwargs.pop( "color", next(ax._get_lines.color_cycle))
from matplotlib import __version__
if __version__ >= '1.5':
colordef = next(ax._get_lines.prop_cycler)
else:
colordef = next(ax._get_lines.color_cycle)
color = kwargs.pop( "color", colordef)
linestyle = kwargs.pop( "linestyle", '-')
label = kwargs.pop( "label", None)
marker = kwargs.pop( "marker", 'o')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment