wvs map: zone labels hug the hull edge (no arrows) + flip X axis

Replace the fling-to-open-space-with-a-leader zone placement with _hull_label_pos:
walk the hull's own boundary vertices, nudge each slightly outward, and put the
label on the vertex whose nearest dot/label is farthest -- so the name sits against
an uncrowded arc of its own outline, no leader line. And flip X (invert_x) so
Self-expression is on the left and Survival on the right: this is a better map than
the Economist's, and it puts the cultural West on the left / East Asia on the right.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
wassname
2026-07-05 13:02:35 +08:00
co-authored by Claudypoo
parent 88d9994c96
commit aa675bc8de
2 changed files with 32 additions and 33 deletions
+5 -2
View File
@@ -298,10 +298,13 @@ def main() -> None:
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()}
# Flip X so Self-expression is on the LEFT and Survival on the RIGHT (invert_x). We are building a
# better map than the Economist's, not xeroxing it, and this puts the cultural "West" on the left.
# poles are (x_left, x_right, y_bottom, y_top) as DRAWN, so the x pair is swapped to match.
fig = maps.plot_value_map(
"WVS Inglehart-Welzel", countries, P,
("Survival", "Self-expression", "Traditional", "Secular-Rational"),
models=plot_models, model_labels=model_labels, emphasize=emph)
("Self-expression", "Survival", "Traditional", "Secular-Rational"),
models=plot_models, model_labels=model_labels, emphasize=emph, invert_x=True)
fig.savefig(args.out, dpi=200, bbox_inches="tight")
logger.info(f"wrote {args.out}")