Преглед изворни кода

Add a way to access the colors used by the plots externally.

Carlos Garcia пре 6 година
родитељ
комит
0b0ec1c139
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      paper_plots.py

+ 3 - 1
paper_plots.py

@@ -5,6 +5,8 @@ import matplotlib as mpl
 import matplotlib.pyplot as plt
 from cycler import cycler
 
+paper_colors = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf']
+
 # set global settings
 def pre_paper_plot(change=True):
     if not change:
@@ -24,7 +26,7 @@ def pre_paper_plot(change=True):
     plt.rcParams['axes.grid'] = False
     plt.rcParams['axes.labelcolor'] = 'black'
     #plt.rcParams['axes.color_cycle'] = '8cd0d3, 7f9f7f, cc9393, 93e0e3, dc8cc3, f0dfaf, dcdccc'
-    plt.rcParams['axes.prop_cycle'] = cycler('color', ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'])
+    plt.rcParams['axes.prop_cycle'] = cycler('color', paper_colors)
     plt.rcParams['xtick.color'] = 'k'
     plt.rcParams['xtick.direction'] = 'in'
     plt.rcParams['ytick.color'] = 'k'