"""Shared matplotlib style (validated categorical palette, light surface, recessive axes).""" import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt SURFACE = "#fcfcfb" INK = "#0b0b0b" INK2 = "#52514e" GRID = "#e4e3df" BLUE, ORANGE, AQUA, YELLOW, MAGENTA, GREEN, VIOLET, RED = ( "#2a78d6", "#eb6834", "#1baf7a", "#eda100", "#e87ba4", "#008300", "#6250d6", "#e34948") GREY = "#8c8b86" def apply(): plt.rcParams.update({ "figure.facecolor": SURFACE, "axes.facecolor": SURFACE, "savefig.facecolor": SURFACE, "axes.edgecolor": GRID, "axes.labelcolor": INK2, "text.color": INK, "xtick.color": INK2, "ytick.color": INK2, "axes.grid": True, "grid.color": GRID, "grid.linewidth": 0.6, "axes.spines.top": False, "axes.spines.right": False, "font.size": 10, "axes.titlesize": 11, "axes.titleweight": "bold", "axes.titlelocation": "left", "legend.frameon": False, "legend.fontsize": 8.5, "lines.linewidth": 2.0, "figure.dpi": 150, "savefig.dpi": 170, "font.family": "DejaVu Sans", }) return plt