-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_style.py
More file actions
62 lines (57 loc) · 1.88 KB
/
plot_style.py
File metadata and controls
62 lines (57 loc) · 1.88 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
62
# Centralized plotting style for analysis scripts.
# Import and call set_plot_style() before generating figures.
import matplotlib.pyplot as plt
def set_plot_style():
plt.style.use("default")
plt.rcParams.update(
{
# Figure settings
"figure.figsize": (8, 5),
"figure.dpi": 120,
"figure.facecolor": "white",
"savefig.dpi": 300,
"savefig.bbox": "tight",
# Font sizes
"axes.titlesize": 17,
"axes.labelsize": 16,
"xtick.labelsize": 16,
"ytick.labelsize": 16,
"legend.fontsize": 16,
"legend.title_fontsize": 16,
# Line settings
"lines.linewidth": 2,
"lines.markersize": 3,
# Tick settings
"xtick.direction": "in",
"ytick.direction": "in",
"xtick.minor.visible": True,
"ytick.minor.visible": True,
"xtick.major.size": 6,
"ytick.major.size": 6,
"xtick.minor.size": 3,
"ytick.minor.size": 3,
"axes.spines.top": True,
"axes.spines.right": True,
# Axes appearance
"axes.linewidth": 1.0,
"axes.grid": False,
# Legend
"legend.frameon": True,
"legend.framealpha": 1.0,
"legend.fancybox": True,
"legend.shadow": True,
"legend.facecolor": "white",
"legend.edgecolor": "#cccccc",
"legend.loc": "best",
"legend.markerscale": 1.0,
# Histogram styling
"patch.edgecolor": "black",
"patch.linewidth": 0.8,
# Fonts
"font.family": "sans-serif",
"font.sans-serif": ["DejaVu Sans"],
# Grid
"grid.alpha": 0.25,
"grid.linestyle": "--",
}
)