wvs map: emptiest-slot zone labels + one label per model family

Zone labels now get a dedicated open-space search (_open_slot: scan a ring around
the hull centroid, keep the slot whose nearest dot/label is farthest) instead of
adjustText's local minimum -- so Latin America/African-Islamic land in the sparse
margins with a leader to their hull, not the crowded centre. And with 17 models the
names were too many: plot every star but LABEL only the latest per family (highest
version), dropping the redundant 'claude-' so the flagship reads 'opus-4.8'. Colour
+ legend carry the unlabelled siblings.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
wassname
2026-07-05 12:54:00 +08:00
co-authored by Claudypoo
parent e7810e4a0d
commit 88d9994c96
2 changed files with 62 additions and 17 deletions
+10 -1
View File
@@ -289,10 +289,19 @@ def main() -> None:
# Drop the " (rated)" readout tag from the on-map labels (the cache/CI-table keep it) -- the map is
# crowded and every model here is rated, so the tag adds nothing.
plot_models = {k.replace(" (rated)", ""): v for k, v in models.items()}
# Too many model names to label them all. Plot every star (colour = family) but LABEL only the
# latest model per family (highest version number), and drop the redundant "claude-" so the flagship
# reads "opus-4.8". Colour + legend carry the unlabelled siblings.
fams: dict[str, list[str]] = {}
for k in plot_models:
fams.setdefault(maps.model_family_color(k), []).append(k)
def _ver(k: str) -> list[float]:
return [float(n) for n in re.findall(r"\d+(?:\.\d+)?", k)]
model_labels = {max(ks, key=_ver): max(ks, key=_ver).replace("claude-", "") for ks in fams.values()}
fig = maps.plot_value_map(
"WVS Inglehart-Welzel", countries, P,
("Survival", "Self-expression", "Traditional", "Secular-Rational"),
models=plot_models, emphasize=emph)
models=plot_models, model_labels=model_labels, emphasize=emph)
fig.savefig(args.out, dpi=200, bbox_inches="tight")
logger.info(f"wrote {args.out}")