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"),