Implement dark mode using style sheets

This commit is contained in:
Bernhard Manfred Gruber
2026-02-05 14:00:33 +01:00
parent ec9759037d
commit 28ed32bb47

View File

@@ -239,16 +239,9 @@ def plot_entries(entries, title=None, output=None, dark=False):
colors = [bench_colors[bench] for bench in bench_names]
fig_height = max(4.0, 0.3 * len(entries) + 1.5)
style = "dark_background" if dark else None
with plt.style.context(style) if style else plt.style.context("default"):
fig, ax = plt.subplots(figsize=(10, fig_height))
if dark:
fig.patch.set_facecolor("black")
ax.set_facecolor("black")
ax.tick_params(colors="white")
ax.xaxis.label.set_color("white")
ax.yaxis.label.set_color("white")
ax.title.set_color("white")
for spine in ax.spines.values():
spine.set_color("white")
y_pos = range(len(labels))
ax.barh(y_pos, values, color=colors)