Skip to content

Commit a87611f

Browse files
Adding dark mode on all plots by default
1 parent 7496e14 commit a87611f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/autoencoder/data/visualize.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@
1111
from numpy.typing import NDArray
1212

1313

14+
def set_background_style(style: str) -> None:
15+
"""Set MatplotLib plot background style."""
16+
plt.style.use(style)
17+
18+
19+
def toggle_dark_mode() -> None:
20+
"""Turn on dark mode."""
21+
set_background_style("dark_background")
22+
23+
24+
def toggle_light_mode() -> None:
25+
"""Turn on light mode."""
26+
set_background_style("default")
27+
28+
1429
def training_loss_history(
1530
history: Dict[str, List[float]], model_name: str = "Autoencoder"
1631
) -> None:
@@ -144,3 +159,7 @@ def plot_anomalous_images(
144159

145160
# close after plot
146161
plt.close()
162+
163+
164+
# toggle dark mode by default
165+
toggle_dark_mode()

0 commit comments

Comments
 (0)