mirror of
https://github.com/wassname/moral-maps.git
synced 2026-09-12 12:32:34 +08:00
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:
+10
-1
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user