spb/traite-evaluation-qc
Public
1#!/usr/bin/env python32"""Figure ch07 — sensibilité de la cotisation de seuil A* à l'inflation des coûts et au rendement du fonds (DONNÉES SYNTHÉTIQUES).3Sortie : assets/figures/ch07/ch07-fig-sensibilite-cotisation.pdf"""4import sys, pathlib5ROOT = pathlib.Path(__file__).resolve().parents[3]6sys.path.insert(0, str(ROOT / "analysis/python")); sys.path.insert(0, str(ROOT / "analysis/python/cases"))7import matplotlib.pyplot as plt8from traite.style import setup, palette, savefig, LARGEUR, fmt_dollars9import ch07_servitudes_copro as cas1011def main():12 setup()13 s = cas.sensibilite_cotisation(); regle = 0.005 * cas.VALEUR_RECONSTRUCTION14 fig, ax = plt.subplots(figsize=(LARGEUR, 3.2))15 for i, (r, row) in enumerate(s["grille"].items()):16 ax.plot([p * 100 for p in s["inflations"]], row, marker="o", color=palette.cat[i], label=f"rendement du fonds r = {r*100:.0f} %")17 ax.axhline(regle, color=palette.ink2, lw=0.9, ls=":")18 ax.text(1.52, regle + 250, "règle du 0,5 % de la valeur de reconstruction (21 000 $)", fontsize=7.5, color=palette.ink2)19 ax.axhline(cas.COTISATION_ACTUELLE, color=palette.cat[3], lw=0.9, ls=":")20 ax.text(1.52, cas.COTISATION_ACTUELLE + 250, "cotisation actuelle (12 000 $)", fontsize=7.5, color=palette.cat[3])21 ax.set_xlabel("Hausse annuelle des coûts de construction π (%)"); ax.set_ylabel("Cotisation de seuil A* (an 1)")22 ax.yaxis.set_major_formatter(plt.FuncFormatter(fmt_dollars)); ax.set_ylim(10000, 26000)23 ax.legend(loc="lower right", fontsize=7.5)24 out = savefig(fig, "ch07/ch07-fig-sensibilite-cotisation.pdf"); print("OK", out)2526if __name__ == "__main__":27 main()28