"""Matplotlib styling shared by all figures (validated reference palette; static PNG output).""" import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt SURFACE = "#fcfcfb" INK = "#0b0b0b" INK2 = "#52514e" MUTED = "#898781" GRID = "#e1e0d9" AXIS = "#c3c2b7" # categorical slots (first three validate for all-pairs use, e.g. scatter) BLUE, ORANGE, AQUA, YELLOW, MAGENTA, GREEN, VIOLET, RED = ( "#2a78d6", "#eb6834", "#1baf7a", "#eda100", "#e87ba4", "#008300", "#6250d6", "#e34948") NEUTRAL = "#898781" # sequential blue ramp (light -> dark) for ordered series SEQ_BLUE = ["#9ec5f4", "#6da7ec", "#3987e5", "#256abf", "#184f95", "#0d366b"] SEQ_ORANGE = ["#f6c3ab", "#f09a75", "#eb6834", "#c24f22", "#8f3915"] def apply(): plt.rcParams.update({ "figure.facecolor": SURFACE, "axes.facecolor": SURFACE, "savefig.facecolor": SURFACE, "font.family": "sans-serif", "font.size": 10.5, "text.color": INK, "axes.labelcolor": INK2, "axes.titlecolor": INK, "xtick.color": MUTED, "ytick.color": MUTED, "xtick.labelcolor": INK2, "ytick.labelcolor": INK2, "axes.edgecolor": AXIS, "axes.linewidth": 0.8, "axes.grid": True, "grid.color": GRID, "grid.linewidth": 0.8, "grid.linestyle": "-", "axes.spines.top": False, "axes.spines.right": False, "axes.titlesize": 11.5, "axes.titleweight": "bold", "axes.titlelocation": "left", "axes.labelsize": 10.5, "legend.frameon": False, "legend.fontsize": 9.5, "lines.linewidth": 2.0, "lines.solid_capstyle": "round", "lines.solid_joinstyle": "round", "figure.dpi": 110, "savefig.dpi": 170, "savefig.bbox": "tight", }) return plt