Closed cdabella closed 3 years ago
Found a potentially relevant answer here: https://stackoverflow.com/questions/4971269/how-to-pick-a-new-color-for-each-plotted-line-within-a-figure-in-matplotlib/39522128#39522128
# cycler is a separate package extracted matplotlib.
from cycler import cycler
import matplotlib.pyplot as plt
plt.rc('axes', prop_cycle=(cycler('color', ['r', 'g', 'b'])))
plt.plot([1, 2])
plt.plot([2, 3])
plt.plot([3, 4])
plt.plot([4, 5])
plt.plot([5, 6])
plt.show()
Will report back if it works.
import matplotlib as mpl
from cycler import cycler
mpl.rcParams.update(
{
"lines.linewidth": 2.0,
"axes.edgecolor": "#bcbcbc",
"patch.linewidth": 0.5,
"legend.fancybox": True,
"axes.prop_cycle": cycler('color', [
"#348ABD",
"#A60628",
"#7A68A6",
"#467821",
"#CF4457",
"#188487",
"#E24A33"
]),
"axes.facecolor": "#eeeeee",
"axes.labelsize": "large",
"axes.grid": True,
"patch.edgecolor": "#eeeeee",
"axes.titlesize": "x-large",
"svg.fonttype": "path",
"examples.directory": ""
}
)
colors = ["#348ABD", "#A60628", "#7A68A6", "#467821"]
axes.color_cycle has been deprecated to be replaced by axes.prop_cycle. Fix required in both matplotlibrc and bmh_matplotlibrc.json for continued compatibility.
https://matplotlib.org/api/api_changes.html#color-cycle-deprecated