Fig. 1A icons: committed SVGs rasterised at build time; CDN PNGs removed
The two Flaticon icons (licensed via GG's paid subscription) are now committed as SVG source and rasterised at 2048 px by make_figs.py via rsvg-convert (~6000 DPI at the placed size - print-lossless), keeping every figure a pure function of the script plus committed sources. The 512 px CDN PNGs are gone; a clear error names the librsvg dependency if rsvg-convert is missing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BkRLcc18rwT2Lysu6PbG7v
This commit is contained in:
parent
9055fca792
commit
c9c4d927ad
7 changed files with 29 additions and 7 deletions
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB |
1
paper/pnas/figs/icons/pea.svg
Normal file
1
paper/pnas/figs/icons/pea.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
1
paper/pnas/figs/icons/robot.svg
Normal file
1
paper/pnas/figs/icons/robot.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg id="Layer_1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg" data-name="Layer 1"><rect fill="#eff3f9" height="29" rx="4" width="34" x="7" y="15"/><path d="m11 38v-23c-2.209 0-4 1.791-4 4v21c0 2.209 1.791 4 4 4h26c2.209 0 4-1.791 4-4h-28c-1.105 0-2-.895-2-2z" fill="#cfe0f3"/><circle cx="18" cy="25" fill="#afb4c2" r="2"/><circle cx="30" cy="25" fill="#afb4c2" r="2"/><path d="m45 36h-4v-13h4c1.105 0 2 .895 2 2v9c0 1.105-.895 2-2 2z" fill="#8c94af"/><path d="m3 36h4v-13h-4c-1.105 0-2 .895-2 2v9c0 1.105.895 2 2 2z" fill="#8c94af"/><path d="m45 32h-4v4h4c1.105 0 2-.895 2-2v-4c0 1.105-.895 2-2 2z" fill="#6f7792"/><path d="m1 30v4c0 1.105.895 2 2 2h4v-4h-4c-1.105 0-2-.895-2-2z" fill="#6f7792"/><circle cx="24" cy="6" fill="#ff3b65" r="3"/><path d="m25.5 7c-1.381 0-2.5-1.119-2.5-2.5 0-.54.175-1.037.467-1.446-1.402.252-2.467 1.472-2.467 2.946 0 1.657 1.343 3 3 3 1.474 0 2.694-1.065 2.946-2.467-.409.291-.906.467-1.446.467z" fill="#d82b50" opacity=".75"/><g fill="#08105e"><path d="m21 25c0-1.654-1.346-3-3-3s-3 1.346-3 3 1.346 3 3 3 3-1.346 3-3zm-3 1c-.551 0-1-.448-1-1s.449-1 1-1 1 .449 1 1-.449 1-1 1z"/><path d="m30 22c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3zm0 4c-.551 0-1-.448-1-1s.449-1 1-1 1 .449 1 1-.449 1-1 1z"/><path d="m28.543 33.91c-2.815 1.447-6.271 1.447-9.086 0-.492-.253-1.094-.059-1.347.433s-.059 1.094.433 1.347c1.669.857 3.556 1.311 5.457 1.311s3.788-.453 5.457-1.311c.491-.253.685-.855.433-1.347s-.855-.686-1.347-.433z"/><path d="m45 22h-3v-3c0-2.757-2.243-5-5-5h-12v-4.142c1.72-.447 3-2 3-3.858 0-2.206-1.794-4-4-4s-4 1.794-4 4c0 1.858 1.28 3.411 3 3.858v4.142h-12c-2.757 0-5 2.243-5 5v3h-3c-1.654 0-3 1.346-3 3v9c0 1.654 1.346 3 3 3h3v3c0 2.757 2.243 5 5 5h26c2.757 0 5-2.243 5-5v-3h3c1.654 0 3-1.346 3-3v-9c0-1.654-1.346-3-3-3zm-23-16c0-1.103.897-2 2-2s2 .897 2 2-.897 2-2 2-2-.897-2-2zm-19 29c-.551 0-1-.448-1-1v-9c0-.551.449-1 1-1h3v11zm37 5c0 1.654-1.346 3-3 3h-26c-1.654 0-3-1.346-3-3v-21c0-1.654 1.346-3 3-3h26c1.654 0 3 1.346 3 3zm6-6c0 .552-.449 1-1 1h-3v-11h3c.551 0 1 .449 1 1z"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 2 KiB |
Binary file not shown.
|
|
@ -42,21 +42,41 @@ def save(fig, name):
|
||||||
print("wrote", OUT / f"{name}.pdf")
|
print("wrote", OUT / f"{name}.pdf")
|
||||||
|
|
||||||
|
|
||||||
|
def _icon(svg_name: str):
|
||||||
|
"""Rasterise a committed icon SVG at 2048 px (print-lossless at the ~0.3 in placed size).
|
||||||
|
|
||||||
|
Requires ``rsvg-convert`` (librsvg). The SVGs are the committed source of truth; no derived
|
||||||
|
PNGs are kept in the repo.
|
||||||
|
"""
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
svg = OUT / "icons" / svg_name
|
||||||
|
with tempfile.NamedTemporaryFile(suffix=".png") as f:
|
||||||
|
try:
|
||||||
|
subprocess.run(["rsvg-convert", "-w", "2048", "-h", "2048", "-o", f.name, str(svg)],
|
||||||
|
check=True, capture_output=True)
|
||||||
|
except FileNotFoundError as e:
|
||||||
|
raise RuntimeError("rsvg-convert (librsvg) is required to rasterise the icon SVGs "
|
||||||
|
"for fig1a") from e
|
||||||
|
return plt.imread(f.name)
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------- fig 1: experimental programme
|
# ---------------------------------------------------------------- fig 1: experimental programme
|
||||||
def fig1a():
|
def fig1a():
|
||||||
from matplotlib.patches import FancyBboxPatch
|
from matplotlib.patches import FancyBboxPatch
|
||||||
|
|
||||||
# (name, architecture, guarantee, edge, cell face, header fill, header text colour, icon)
|
# (name, architecture, guarantee, edge, cell face, header fill, header text colour, icon)
|
||||||
# Icons: Flaticon #2347052 (green pea, for Mendel) and #10479785 (robot), used under GG's
|
# Icons: Flaticon #2347052 (green pea, for Mendel) and #10479785 (robot) as committed SVGs,
|
||||||
# paid Flaticon licence.
|
# used under GG's paid Flaticon licence; rasterised at build time by _icon().
|
||||||
TIERS = [
|
TIERS = [
|
||||||
("Biological model", "Wright\u2013Fisher simulator (NumPy)", "closed forms \u00b7 bitwise-reproducible",
|
("Biological model", "Wright\u2013Fisher simulator (NumPy)", "closed forms \u00b7 bitwise-reproducible",
|
||||||
"#4e8d4e", "#eef6ec", "#c5e0bd", "#2d5b2d", "icons/pea.png"),
|
"#4e8d4e", "#eef6ec", "#c5e0bd", "#2d5b2d", "pea.svg"),
|
||||||
("Trained networks", "RNN \u00b7 MLP \u00b7 VAE on a synthetic oracle;\nconvolutional VAE on MNIST",
|
("Trained networks", "RNN \u00b7 MLP \u00b7 VAE on a synthetic oracle;\nconvolutional VAE on MNIST",
|
||||||
"sign-level tests \u00b7 exact oracles", "#5b9bc9", "#eff6fb", "#c9e2f2", "#1f4e79",
|
"sign-level tests \u00b7 exact oracles", "#5b9bc9", "#eff6fb", "#c9e2f2", "#1f4e79",
|
||||||
"icons/robot.png"),
|
"robot.svg"),
|
||||||
("Language models", "LoRA specialists on Qwen 0.5B & 7B;\nexact-match verifier",
|
("Language models", "LoRA specialists on Qwen 0.5B & 7B;\nexact-match verifier",
|
||||||
"seed-replicated signs", "#3c6ea5", "#e7eef8", "#adc8e8", "#1d3f66", "icons/robot.png"),
|
"seed-replicated signs", "#3c6ea5", "#e7eef8", "#adc8e8", "#1d3f66", "robot.svg"),
|
||||||
]
|
]
|
||||||
ROWS = [
|
ROWS = [
|
||||||
("Grounding = immigration",
|
("Grounding = immigration",
|
||||||
|
|
@ -115,8 +135,8 @@ def fig1a():
|
||||||
linespacing=1.3, color=textcol)
|
linespacing=1.3, color=textcol)
|
||||||
ax.text(xc, 0.833, guarantee, ha="center", va="bottom", fontsize=6.4,
|
ax.text(xc, 0.833, guarantee, ha="center", va="bottom", fontsize=6.4,
|
||||||
style="italic", color=textcol, alpha=0.85)
|
style="italic", color=textcol, alpha=0.85)
|
||||||
img = plt.imread(str(OUT / icon))
|
img = _icon(icon)
|
||||||
ax.add_artist(AnnotationBbox(OffsetImage(img, zoom=0.055),
|
ax.add_artist(AnnotationBbox(OffsetImage(img, zoom=28.0 / img.shape[0]),
|
||||||
(x + cw - gap - 0.024, 0.902), frameon=False))
|
(x + cw - gap - 0.024, 0.902), frameon=False))
|
||||||
|
|
||||||
for i2, (label, definition, cells) in enumerate(ROWS):
|
for i2, (label, definition, cells) in enumerate(ROWS):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue