From 5e8c4973dd17ee83a7aa524c82d2bdb4633442ab Mon Sep 17 00:00:00 2001 From: Jongwook Choi Date: Tue, 7 Nov 2023 01:38:04 -0500 Subject: [PATCH] colors: Add MatplotlibDefault palette --- expt/colors.py | 16 +++++++++++++++- expt/plot.py | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/expt/colors.py b/expt/colors.py index b286cfe..4ddb61a 100644 --- a/expt/colors.py +++ b/expt/colors.py @@ -22,9 +22,23 @@ del sys del _thismodule +# Matplotlib default cycle +MatplotlibDefault = ( + '#1f77b4', + '#ff7f0e', + '#2ca02c', + '#d62728', + '#9467bd', + '#8c564b', + '#e377c2', + '#7f7f7f', + '#bcbd22', + '#17becf', +) + # Sensible default color sets that are more distinguishable: 17 colors # https://matplotlib.org/3.1.0/gallery/color/named_colors.html -DefaultColors = ( +ExptSensible17 = ( 'dimgray', 'dodgerblue', 'limegreen', diff --git a/expt/plot.py b/expt/plot.py index 305b128..623842d 100644 --- a/expt/plot.py +++ b/expt/plot.py @@ -961,8 +961,8 @@ def __call__( if 'color' not in axes_props[0].keys(): # axes.prop_cycle does not have color. Fall back to default colors - from .colors import DefaultColors - color_it = itertools.cycle(DefaultColors) + from .colors import ExptSensible17 + color_it = itertools.cycle(ExptSensible17) for prop, c in zip(axes_props, color_it): prop['color'] = c