[f3902c]: / src / scpanel / settings.py

Download this file

62 lines (49 with data), 1.7 kB

 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from cycler import cycler
from matplotlib import rcParams
from . import palettes
def set_rcParams(fontsize=14, color_map=None):
"""Set default matplotlib.rcParams"""
# figure
rcParams["figure.figsize"] = (4, 4)
rcParams["figure.dpi"] = 300
rcParams["figure.subplot.left"] = 0.18
rcParams["figure.subplot.right"] = 0.96
rcParams["figure.subplot.bottom"] = 0.15
rcParams["figure.subplot.top"] = 0.91
rcParams["lines.linewidth"] = 1.5 # the line width of the frame
rcParams["lines.markersize"] = 6
rcParams["lines.markeredgewidth"] = 1
# font
rcParams["font.sans-serif"] = [
"Arial",
"Helvetica",
"DejaVu Sans",
"Bitstream Vera Sans",
"sans-serif",
]
fontsize = fontsize
rcParams["font.size"] = fontsize
rcParams["legend.fontsize"] = 0.92 * fontsize
rcParams["axes.titlesize"] = fontsize
rcParams["axes.labelsize"] = fontsize
# legend
rcParams["legend.numpoints"] = 1
rcParams["legend.scatterpoints"] = 1
rcParams["legend.handlelength"] = 0.5
rcParams["legend.handletextpad"] = 0.4
# color cycle
rcParams["axes.prop_cycle"] = cycler(color=palettes.default_20)
# lines
rcParams["axes.linewidth"] = 0.8
rcParams["axes.edgecolor"] = "black"
rcParams["axes.facecolor"] = "white"
# ticks
rcParams["xtick.color"] = "k"
rcParams["ytick.color"] = "k"
rcParams["xtick.labelsize"] = fontsize
rcParams["ytick.labelsize"] = fontsize
# axes grid
rcParams["axes.grid"] = False
rcParams["grid.color"] = ".8"
# color map
rcParams["image.cmap"] = rcParams["image.cmap"] if color_map is None else color_map