From 7ae8a1786d0adc06b536c145f457925ccdeccd5b Mon Sep 17 00:00:00 2001 From: Jan Benda Date: Mon, 6 Jan 2020 21:33:14 +0100 Subject: [PATCH] [plotstyle] default color cycler --- plotstyle.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plotstyle.py b/plotstyle.py index 5c0be24..b31894a 100644 --- a/plotstyle.py +++ b/plotstyle.py @@ -1,5 +1,6 @@ import matplotlib as mpl import matplotlib.pyplot as plt +from cycler import cycler from mpl_toolkits.mplot3d import Axes3D xkcd_style = False @@ -353,6 +354,16 @@ def common_format(): mpl.rcParams['ytick.direction'] = 'out' mpl.rcParams['xtick.major.width'] = 1.25 mpl.rcParams['ytick.major.width'] = 1.25 + if 'axes.prop_cycle' in mpl.rcParams: + mpl.rcParams['axes.prop_cycle'] = cycler(color=[colors['blue'], colors['red'], + colors['orange'], colors['green'], + colors['purple'], colors['yellow'], + colors['cyan'], colors['pink']]) + else: + mpl.rcParams['axes.color_cycle'] = [colors['blue'], colors['red'], + colors['orange'], colors['green'], + colors['purple'], colors['yellow'], + colors['cyan'], colors['pink']] # overwrite axes constructor: if not hasattr(mpl.axes.Subplot, '__init__orig'): mpl.axes.Subplot.__init__orig = mpl.axes.Subplot.__init__