CamDavidsonPilon / Probabilistic-Programming-and-Bayesian-Methods-for-Hackers

aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)
http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/
MIT License
26.55k stars 7.85k forks source link

axes.color_cycle deprecated in matplotlib 2.2.0 #395

Closed cdabella closed 3 years ago

cdabella commented 6 years ago

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

BKJackson commented 6 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.

estsaon commented 5 years ago
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": ""
    }
)
NikolayTach commented 3 years ago


colors = ["#348ABD", "#A60628", "#7A68A6", "#467821"]