From c869e6dda6da2e774e13c3c03e46e5e3160d7f98 Mon Sep 17 00:00:00 2001
From: Amir MOHAMMADI <amir.mohammadi@idiap.ch>
Date: Wed, 26 Jul 2017 21:42:02 +0200
Subject: [PATCH] implement colors for more than 10 files

---
 bob/bio/base/script/evaluate.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bob/bio/base/script/evaluate.py b/bob/bio/base/script/evaluate.py
index 734118fb..4e1da2ae 100644
--- a/bob/bio/base/script/evaluate.py
+++ b/bob/bio/base/script/evaluate.py
@@ -225,10 +225,12 @@ def main(command_line_parameters=None):
   args = command_line_arguments(command_line_parameters)
 
   # get some colors for plotting
-  # cmap = pyplot.cm.get_cmap(name='magma')
-  # colors = [cmap(i) for i in numpy.linspace(0, 1.0, len(args.dev_files)+1)]
-  # matplotlib 2.0 default color cycler list: Vega category10 palette
-  colors = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728',
+  if len(args.dev_files) > 10:
+    cmap = pyplot.cm.get_cmap(name='magma')
+    colors = [cmap(i) for i in numpy.linspace(0, 1.0, len(args.dev_files) + 1)]
+  else:
+    # matplotlib 2.0 default color cycler list: Vega category10 palette
+    colors = ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728',
               '#9467bd', '#8c564b', '#e377c2', '#7f7f7f',
               '#bcbd22', '#17becf']
 
-- 
GitLab