-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfessa.py
32 lines (28 loc) · 938 Bytes
/
fessa.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
###################################################################
# Fessa palette for python matplotlib
###################################################################
from matplotlib.colors import LinearSegmentedColormap, ColorConverter
from matplotlib.cm import register_cmap
paletteFessa = [
'#1F3B73', # dark-blue
'#2F9294', # green-blue
'#50B28D', # green
'#A7D655', # pisello
'#FFE03E', # yellow
'#FFA955', # orange
'#D6573B', # red
]
cm_fessa = LinearSegmentedColormap.from_list('fessa', paletteFessa)
register_cmap(cmap=cm_fessa)
register_cmap(cmap=cm_fessa.reversed())
for i in range(len(paletteFessa)):
ColorConverter.colors[f'fessa{i}'] = paletteFessa[i]
### To set it as default
# import fessa
# plt.set_cmap('fessa')
### or the reversed one
# plt.set_cmap('fessa_r')
### For contour plots
# plt.contourf(X, Y, Z, cmap='fessa')
### For standard plots
# plt.plot(x, y, color='fessa0')