-
Notifications
You must be signed in to change notification settings - Fork 0
/
fig_settings.py
40 lines (33 loc) · 1018 Bytes
/
fig_settings.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
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 4 10:11:05 2021
@author: John Meluso
"""
import cmasher as cmr
import matplotlib as mpl
import matplotlib.pylab as pylab
# color styling
def set_colors(n_colors=2):
global cmap
global auroc_cmap
global pallette
cmap = "cmr.redshift"
qualitative_cmap = cmr.get_sub_cmap(cmap, 0.2, 0.8, N=n_colors)
auroc_cmap = cmr.get_sub_cmap(cmap, 0.5, 1)
pallette = qualitative_cmap.colors
mpl.rcParams["axes.prop_cycle"] = mpl.cycler(color=pallette)
def set_fonts(extra_params={}):
params = {
"font.family": "Serif",
# "font.sans-serif": ["Tahoma", "DejaVu Sans", "Lucida Grande", "Verdana"],
"mathtext.fontset": "cm",
"legend.fontsize": 12,
"axes.labelsize": 12,
"axes.titlesize": 12,
"xtick.labelsize": 12,
"ytick.labelsize": 12,
"figure.titlesize": 12,
}
for key, value in extra_params.items():
params[key] = value
pylab.rcParams.update(params)