From b0b5202ed4dc8db3d0e24baaa6a12e2ebdeebfa6 Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Wed, 3 Dec 2025 11:42:01 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20du=20nombre=20de=20pi=C3=A8ces=20dans?= =?UTF-8?q?=20le=20top=20des=20sets=20les=20plus=20color=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plots/color_richness.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/plots/color_richness.py b/lib/plots/color_richness.py index 6af58c4..1475614 100644 --- a/lib/plots/color_richness.py +++ b/lib/plots/color_richness.py @@ -77,6 +77,7 @@ def plot_richness_top_sets(richness_path: Path, destination_path: Path) -> None: top_rows = select_top_sets(rows) y_positions = np.arange(len(top_rows)) counts = [int(row["colors_distinct"]) for row in top_rows] + total_parts = [int(row["total_parts_non_spare"]) for row in top_rows] labels = [f"{row['set_num']} · {row['name']} ({row['year']})" for row in top_rows] owned_mask = [row["in_collection"] == "true" for row in top_rows] @@ -90,6 +91,9 @@ def plot_richness_top_sets(richness_path: Path, destination_path: Path) -> None: ax.set_xlabel("Couleurs distinctes (hors rechanges)") ax.set_title("Top des sets les plus colorés") ax.grid(axis="x", linestyle="--", alpha=0.3) + pad = max(counts) * 0.035 + for y, value, parts in zip(y_positions, counts, total_parts): + ax.text(value + pad, y, f"{parts} pièces", va="center", ha="left", fontsize=9, color="#333333") legend = [ Patch(facecolor="#2ca02c", edgecolor="none", alpha=0.92, label="Set possédé"), Patch(facecolor="#2ca02c", edgecolor="none", alpha=0.45, label="Set manquant"),