From 9e24059104278ab8a7bc4c5355e8d132cdf6fd7f Mon Sep 17 00:00:00 2001 From: marco cammarata Date: Wed, 28 Sep 2016 10:05:44 +0200 Subject: [PATCH] new color and mc.color function --- mcutils.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mcutils.py b/mcutils.py index 48882a6..05378f3 100644 --- a/mcutils.py +++ b/mcutils.py @@ -31,6 +31,17 @@ nice_colors = ( "#F15854", # (red) ) + +nice_colors = ['#014636', + '#016c59', + '#02818a', + '#3690c0', + '#67a9cf', + '#a6bddb', + '#d0d1e6', + '#ece2f0'] + + def colormap( list_of_colors ): from matplotlib.colors import colorConverter,LinearSegmentedColormap c = [ colorConverter.to_rgba(l) for l in list_of_colors ] @@ -761,13 +772,17 @@ def writeMatrix(fout,M,x,y,form="%+.6g",sep=" ",header=None): ### MATPLOTLIB ... ETC. ### -def lt(i,style="-"): - colors="rkbgy" +def lt(i,style="-",colors='rgbk'): i = i%len(colors) color = colors[i] if (style is not None): color += style return color +def color(i,colors=nice_colors): + i = i%len(colors) + color = colors[i] + return color + def displayFig(i,x=None,y=None,roi=None): import pylab as plt from matplotlib.widgets import Slider, Button, RadioButtons