1

Ajout du nombre de pièces dans le top des sets les plus colorés

This commit is contained in:
Richard Dern 2025-12-03 11:42:01 +01:00
parent 39af0d3a8b
commit b0b5202ed4

View File

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