SPB Git

spb/wp5_uqo Public

UQO Working Paper No. 5 — Airbnb, residential rents and housing market pressure.

TeX 53.4% Python 46.5%
1.4 KB · 49 lines python
Raw Blame History
1# Author: Simon-Pierre Boucher — contact@spboucher.ai2"""3Shared matplotlib configuration.45Two publication styles are used in the original pipeline and are preserved6exactly so regenerated figures match the originals:78- `use_descriptive_style()` — seaborn whitegrid, used by the descriptive9  figures (script 05).10- `use_publication_style()` — serif fonts, used by the ML robustness and11  additional-figures scripts (scripts 09 and 10).12"""1314import matplotlib1516matplotlib.use("Agg")  # non-interactive backend1718import matplotlib.pyplot as plt  # noqa: E402  (backend must be set first)192021def use_descriptive_style() -> None:22    """Style for the descriptive tables/figures script."""23    plt.style.use("seaborn-v0_8-whitegrid")24    plt.rcParams.update({25        "font.size": 11,26        "axes.titlesize": 13,27        "axes.labelsize": 12,28        "xtick.labelsize": 10,29        "ytick.labelsize": 10,30        "figure.dpi": 150,31        "savefig.dpi": 300,32        "savefig.bbox": "tight",33        "pdf.fonttype": 42,  # TrueType for journal submission34    })353637def use_publication_style() -> None:38    """Serif style for the ML and robustness figure scripts."""39    plt.rcParams.update({40        "font.family": "serif",41        "font.size": 10,42        "axes.titlesize": 12,43        "axes.labelsize": 11,44        "figure.figsize": (7, 5),45        "figure.dpi": 150,46        "savefig.bbox": "tight",47        "savefig.pad_inches": 0.05,48    })49