Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified paper_figures/fig0_graphical_abstract.pdf
Binary file not shown.
Binary file modified paper_figures/fig0_graphical_abstract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 15 additions & 24 deletions scripts/make_graphical_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ def pct_of(a, mm):
return NormalDist().cdf(z) * 100.0


def precision_pct(a, mm):
"""Precision percentile (higher = better): the % of trained raters this
placement is at least as precise as. Inverts the error-rank pct_of so the
displayed number matches the intuitive reading (90th = great)."""
return 100.0 - pct_of(a, mm)


def ordinal(p):
n = int(round(p))
suf = (
Expand Down Expand Up @@ -620,22 +627,6 @@ def ic_globe(cx, cy, s, color):
)


def ic_copyleft(cx, cy, s, color):
ax.add_patch(Circle((cx, cy), s, fill=False, ec=color, lw=1.6, zorder=7))
ax.add_patch(
Arc(
(cx, cy),
s * 1.15,
s * 1.15,
theta1=-50,
theta2=230,
ec=color,
lw=1.7,
zorder=7.1,
)
)


def ic_orcid(cx, cy, s, color="#A6CE39"):
ax.add_patch(Circle((cx, cy), s, fc=color, zorder=7))
txt(
Expand Down Expand Up @@ -1324,8 +1315,8 @@ def data_row(y, nb, count, label, color):
txt(
qx0 + 0.40,
qcy + 0.20,
f"“Your AC sits {COIN_MM} mm from consensus — the {ordinal(pct_of('AC', COIN_MM))} "
f"percentile, where trained raters land within {LM['AC']['p50']:.2f} mm.",
f"“Your AC sits {COIN_MM} mm from consensus — the {ordinal(precision_pct('AC', COIN_MM))} "
f"precision percentile, where trained raters land within {LM['AC']['p50']:.2f} mm.",
size=7.8,
style="italic",
)
Expand Down Expand Up @@ -1458,7 +1449,8 @@ def data_row(y, nb, count, label, color):
[("LIGO", 1.2), ("AC", 1.2), ("PMJ", 0.9), ("SPLE", 3.4)]
):
yy = P_y0 + 1.78 - i * 0.34
p = pct_of(a, mm)
p = pct_of(a, mm) # error-rank: drives the verdict tier/colour
disp = precision_pct(a, mm) # precision percentile (higher = better): shown
c = (
TIER["ex"]
if p < 50
Expand Down Expand Up @@ -1502,7 +1494,7 @@ def data_row(y, nb, count, label, color):
ax.add_patch(
Rectangle(
(rx0 + 1.48, yy - 0.11),
(rx1 - rx0 - 1.68) * p / 100,
(rx1 - rx0 - 1.68) * disp / 100,
0.075,
fc=c,
ec="none",
Expand All @@ -1512,7 +1504,7 @@ def data_row(y, nb, count, label, color):
txt(
rx1 - 0.22,
yy,
f"{v} · {ordinal(p)}",
f"{v} · {ordinal(disp)}",
size=7.2,
color=c,
weight="bold",
Expand Down Expand Up @@ -1552,7 +1544,6 @@ def data_row(y, nb, count, label, color):
LOGO = Path(OUT / "logos")
LOGO_H = 0.30
foundation = [
("gpl", "GPL-3.0 code", ic_copyleft),
("opendata", "Open reference data", ic_stack),
("templateflow", "TemplateFlow", ic_globe),
(
Expand Down Expand Up @@ -1686,6 +1677,6 @@ def _bbox(t):
f"({N_HUMAN}H + {N_MACAQ}M) · max spread {MAX_SPREAD:.1f} mm"
)
print(
f" {COIN_MM} mm -> {CAL_HARD} {ordinal(pct_of(CAL_HARD, COIN_MM))} pct · "
f"{CAL_EASY} {ordinal(pct_of(CAL_EASY, COIN_MM))} pct"
f" {COIN_MM} mm -> {CAL_HARD} {ordinal(precision_pct(CAL_HARD, COIN_MM))} pct · "
f"{CAL_EASY} {ordinal(precision_pct(CAL_EASY, COIN_MM))} pct"
)
Loading