new color and mc.color function

This commit is contained in:
marco cammarata 2016-09-28 10:05:44 +02:00
parent 566ce8ca4e
commit 9e24059104
1 changed files with 17 additions and 2 deletions

View File

@ -31,6 +31,17 @@ nice_colors = (
"#F15854", # (red) "#F15854", # (red)
) )
nice_colors = ['#014636',
'#016c59',
'#02818a',
'#3690c0',
'#67a9cf',
'#a6bddb',
'#d0d1e6',
'#ece2f0']
def colormap( list_of_colors ): def colormap( list_of_colors ):
from matplotlib.colors import colorConverter,LinearSegmentedColormap from matplotlib.colors import colorConverter,LinearSegmentedColormap
c = [ colorConverter.to_rgba(l) for l in list_of_colors ] 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. ### ### MATPLOTLIB ... ETC. ###
def lt(i,style="-"): def lt(i,style="-",colors='rgbk'):
colors="rkbgy"
i = i%len(colors) i = i%len(colors)
color = colors[i] color = colors[i]
if (style is not None): color += style if (style is not None): color += style
return color 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): def displayFig(i,x=None,y=None,roi=None):
import pylab as plt import pylab as plt
from matplotlib.widgets import Slider, Button, RadioButtons from matplotlib.widgets import Slider, Button, RadioButtons