-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig_viz.py
More file actions
35 lines (32 loc) · 1.02 KB
/
config_viz.py
File metadata and controls
35 lines (32 loc) · 1.02 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
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.io as pio
def init_viz(style: str = "seaborn", figsize: tuple = (10, 6), dpi: int = 150) -> None:
# Matplotlib Global Config
plt.rcParams.update({
"figure.figsize": figsize,
"figure.dpi": dpi,
"savefig.dpi": 300,
# Grid
"axes.grid": True,
"grid.color": "black",
"grid.alpha": 0.12,
"grid.linestyle": "--",
"grid.linewidth": 0.8,
# Axes
"axes.edgecolor": "black",
"axes.linewidth": 1.2,
"axes.labelweight": "normal",
"axes.titlesize": 14,
"axes.labelsize": 11,
"axes.spines.top": False,
"axes.spines.right": False,
})
# Seaborn Config
if style == "seaborn":
sns.set_style("white", {"axes.grid": True, "grid.color": "black", "grid.alpha": 0.12})
sns.set_palette("colorblind")
sns.set_context("paper")
# Plotly Config
elif style == "plotly":
pio.templates.default = "plotly_white"