paper_plots: journal-size text, aligned count column, short labels

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D1G8gJVAy6gp1K5Dz3NE5C
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-09-25 16:51:26 +02:00
1 parent 07b0f7e315
commit e1b476bb2b
1 file changed
+17 -16
+17 -16
View File
@@ -38,22 +38,23 @@ set grid lc rgb "#cccccc" lw 1
set border lw 2
set tics scale 1.5
set key off
set style line 1 lc rgb "black" lw 3 dt 2
set style line 2 pt 7 ps 1.1 lc rgb "#1f77b4"
set style line 3 pt 7 ps 1.1 lc rgb "#d62728"
label_box = "Structure number: %(n)d\nFacilities number: %(nf)d\nBeamline number: %(nb)d"
set style line 1 lc rgb "black" lw 4 dt 2
set style line 2 pt 7 ps 1.4 lc rgb "#1f77b4"
set style line 3 pt 7 ps 1.4 lc rgb "#d62728"
# counts: names left-aligned, numbers right-aligned in a column beside them
set label 11 "Structures\nFacilities\nBeamlines" at graph 0.04, graph 0.95 left front
set label 12 "%(n)d\n%(nf)d\n%(nb)d" at graph 0.66, graph 0.95 right front
# --- R-free
set output "%(out)s/rfree.%(ext)s"
set xlabel "R_{free}, depositor data (REFMAC)"
set ylabel "R_{free}, Rugnux data (REFMAC)"
set xrange [%(rlo).2f:%(rhi).2f]; set yrange [%(rlo).2f:%(rhi).2f]
set xtics 0.05; set ytics 0.05
set format x "%%.2f"; set format y "%%.2f"
set label 1 sprintf(label_box) at graph 0.04, graph 0.96 left front
set label 2 "Within ±%(band).2f: %(within)d of %(n)d" at graph 0.96, graph 0.06 right front
set xtics 0.1; set ytics 0.1
set format x "%%.1f"; set format y "%%.1f"
set label 2 "Within ±%(band).2f: %(within)d/%(n)d" at graph 0.96, graph 0.06 right front
plot x ls 1, "%(out)s/rfree.dat" using 1:2 ls 2
unset label 1; unset label 2
unset label 2
# --- high-resolution limit
set output "%(out)s/dmin.%(ext)s"
@@ -61,12 +62,12 @@ set logscale xy
set xlabel "d_{min}, deposition (Å)"
set ylabel "d_{min}, Rugnux (Å)"
set xrange [%(dlo).2f:%(dhi).2f]; set yrange [%(dlo).2f:%(dhi).2f]
set xtics (0.5, 0.7, 1, 1.5, 2, 3, 4, 6, 8)
set ytics (0.5, 0.7, 1, 1.5, 2, 3, 4, 6, 8)
set xtics (0.5, 1, 1.5, 2, 3, 4, 6, 8)
set ytics (0.5, 1, 1.5, 2, 3, 4, 6, 8)
set format x "%%g"; set format y "%%g"
set label 1 sprintf("Structure number: %(dn)d\nFacilities number: %(dnf)d\nBeamline number: %(dnb)d") at graph 0.04, graph 0.96 left front
set label 3 "Rugnux reaches further (%(deeper)d)" at graph 0.96, graph 0.06 right front
set label 4 "Deposition reaches further (%(shallower)d)" at graph 0.04, graph 0.70 left front
set label 12 "%(dn)d\n%(dnf)d\n%(dnb)d" at graph 0.66, graph 0.95 right front
set label 3 "Rugnux deeper: %(deeper)d" at graph 0.96, graph 0.06 right front
set label 4 "Deposition\ndeeper: %(shallower)d" at graph 0.04, graph 0.66 left front
plot x ls 1, "%(out)s/dmin.dat" using 1:2 ls 3
"""
@@ -158,8 +159,8 @@ def main():
rlo=0.05 * math.floor((min(values) - 0.01) / 0.05), rhi=0.05 * math.ceil((max(values) + 0.01) / 0.05),
dlo=0.5, dhi=8.0)
script = ""
for term, ext in (('pdfcairo size 5in,5in font "Helvetica,14"', "pdf"),
('pngcairo size 1500,1500 font "Helvetica,30"', "png")):
for term, ext in (('pdfcairo size 5in,5in font "Helvetica,28"', "pdf"),
('pngcairo size 1500,1500 font "Helvetica,60"', "png")):
script += f"set terminal {term}\n" + GNUPLOT % dict(params, ext=ext) + "\nreset\n"
gp = os.path.join(out, "figures.gp")
open(gp, "w").write(script)