Download code/reproduce/figures/plot_style.py from coarse-grained-forecasting-benchmark/forecasting-models: direct link, hf CLI and curl.
- Browser
- Download file 856 Bytes
-
https://huggingface.co/coarse-grained-forecasting-benchmark/forecasting-models/resolve/main/code/reproduce/figures/plot_style.py
- Command line
-
hf download hf://coarse-grained-forecasting-benchmark/forecasting-models/code/reproduce/figures/plot_style.py
-
curl -L -o plot_style.py https://huggingface.co/coarse-grained-forecasting-benchmark/forecasting-models/resolve/main/code/reproduce/figures/plot_style.py
856 Bytes
| """Shared publication style. Figure dimensions are final printed inches.""" | |
| import os | |
| from pathlib import Path | |
| import matplotlib | |
| matplotlib.use('Agg') | |
| import matplotlib.pyplot as plt | |
| DIRECT = '#356a98' | |
| CASCADED = '#b74445' | |
| EDM = '#777777' | |
| TRUTH = '#222222' | |
| INK = '#222222' | |
| COLORS = {'Direct SI': DIRECT, 'Cascaded SI': CASCADED, 'EDM': EDM, 'Truth': TRUTH} | |
| plt.rcParams.update({ | |
| 'font.family': 'serif', 'font.serif': ['STIXGeneral'], | |
| 'mathtext.fontset': 'stix', 'font.size': 8, | |
| 'axes.labelsize': 8, 'axes.titlesize': 8.5, | |
| 'xtick.labelsize': 7, 'ytick.labelsize': 7, | |
| 'axes.linewidth': .6, 'lines.linewidth': 1.2, | |
| 'pdf.fonttype': 42, 'ps.fonttype': 42, | |
| 'savefig.facecolor': 'white', | |
| }) | |
| def save(fig, path): | |
| fig.savefig(path.with_suffix('.pdf'), dpi=400) | |
| fig.savefig(path.with_suffix('.png'), dpi=240) | |
| plt.close(fig) | |