Buckets:
| """Shared matplotlib style for reproduction figures (dataviz-skill reference palette).""" | |
| import warnings | |
| import matplotlib as mpl | |
| mpl.use("Agg") # headless rendering; avoids macOS GUI state messages in logs | |
| # Apple Accelerate BLAS (numpy 2.x on macOS) emits spurious overflow/divide | |
| # RuntimeWarnings on finite matmuls; every script asserts finiteness of the | |
| # quantities it reports, so silence only that message class. | |
| warnings.filterwarnings("ignore", message=".*encountered in matmul") | |
| # Categorical slots (light mode) from the validated reference palette, fixed order. | |
| SERIES = ["#2a78d6", "#008300", "#e87ba4", "#eda100", "#1baf7a", "#eb6834", "#4a3aa7", "#e34948"] | |
| TEXT_PRIMARY = "#0b0b0b" | |
| TEXT_SECONDARY = "#52514e" | |
| SURFACE = "#fcfcfb" | |
| GRID = "#e5e4e0" | |
| def apply_style(): | |
| mpl.rcParams.update({ | |
| "figure.facecolor": SURFACE, | |
| "axes.facecolor": SURFACE, | |
| "savefig.facecolor": SURFACE, | |
| "axes.edgecolor": GRID, | |
| "axes.labelcolor": TEXT_PRIMARY, | |
| "axes.titlecolor": TEXT_PRIMARY, | |
| "text.color": TEXT_PRIMARY, | |
| "xtick.color": TEXT_SECONDARY, | |
| "ytick.color": TEXT_SECONDARY, | |
| "axes.grid": True, | |
| "grid.color": GRID, | |
| "grid.linewidth": 0.6, | |
| "axes.axisbelow": True, | |
| "axes.spines.top": False, | |
| "axes.spines.right": False, | |
| "lines.linewidth": 2.0, | |
| "font.size": 10, | |
| "axes.titlesize": 11, | |
| "figure.dpi": 150, | |
| "legend.frameon": False, | |
| }) | |
Xet Storage Details
- Size:
- 1.49 kB
- Xet hash:
- fdf07103f4a305b9cfe658e1006a565a34ad438b11dc29c1741b6a95a2fe2998
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.