Figure — four-panel results figure for a trial
A journal-ready four-panel results figure at 180 mm — survival curves, a raincloud, an ROC curve and an updated meta-analysis — composed from four live views and lettered a to d, aligned on their plot areas. Typed FlowScript for 2-D figure composition. Keywords: figure, schematic, diagram, annotation.
Make it your own.
// A journal-ready four-panel results figure at 180 mm — survival curves, a raincloud, an ROC curve and an updated meta-analysis — composed from four live views and lettered a to d, aligned on their plot areas.
//
// Every string below is EXAMPLE text from a fictional trial: replace it.
//
// Each panel is an ordinary view of this document, drawn from its own
// data, so every statistic in the plate is computed rather than pasted:
// (a) time to first heart-failure hospitalisation or cardiovascular
// death, one follow-up time and 0/1 event flag per patient;
// (b) change in six-minute walk distance at 12 weeks, one value per
// patient with a complete walk test at both visits;
// (c) baseline NT-proBNP against hospitalisation within 6 months;
// (d) this trial pooled with five earlier trials. Its own row is the
// Cox hazard ratio fitted to the patients in panel (a) — 0.56 (0.34
// to 0.93) — so the two panels cannot disagree.
//
// The container panel sets the plate (a 3 × 2 grid at 180 mm, a double
// column for most journals); each child panel names one view and its
// cell, and the two wide figures span both columns. Edit
// any view's data and its panel redraws in place. A child view that fails
// to draw becomes a labelled placeholder rather than breaking the plate.
survival primary_endpoint {
title: "Heart-failure hospitalisation or cardiovascular death"
time_unit: "months"
risk_table: true
censor_marks: true
group remote_arm {
label: "Remote monitoring"
times: [
12.7, 23.9, 12.2, 0.7, 10.9, 14.9, 2.2, 16.7, 7.4, 4.8, 9.6, 15.3, 16, 20.4, 14.3,
21.9, 6.3, 11.9, 2.7, 5.8, 8.2, 18.4, 12.6, 6.3, 15.4, 6.1, 0.5, 21.9, 16.9, 13.1,
3.4, 11.5, 12.4, 14.4, 2.4, 22.2, 15, 5, 4.2, 8.5, 22, 12.2, 11.4, 23.4, 8.5,
23.7, 9.4, 21.8, 13.4, 21.9
]
events: [
1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0,
1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0
]
}
group usual_arm {
label: "Usual care"
times: [
20.7, 10.5, 3.1, 3.8, 2.7, 2.8, 13.2, 0.4, 9.9, 18.5, 0.2, 15.8, 3.2, 6.8, 10.1,
18.2, 18, 13.2, 18.1, 9.7, 19.6, 1.6, 1.9, 7.3, 6.7, 21.6, 2, 13.4, 14.8, 4.8,
4.7, 11.4, 5.2, 10.7, 0.5, 12.3, 12.1, 7.6, 11.1, 16.1, 4.1, 2, 1, 1.6, 6.5,
1.7, 0.9, 16.7, 1.8, 22.5
]
events: [
0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1,
0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0
]
}
}
distribution walk_change {
title: "Change in six-minute walk distance at 12 weeks"
label: "Change from baseline"
unit: "m"
kind: raincloud
group walk_remote {
label: "Remote monitoring"
values: [
61, 21, 102, 137, 11, 93, 29, 65, 43, 31, 41, 47, 28, 105, -33, 10, 41, 10, 45, 11,
25, 33, 43, 67, -33, 32, 26, 12, 37, 14, 56, 66, -8, 8, 60, 67, -4, 72, 39, -31
]
}
group walk_usual {
label: "Usual care"
values: [
31, 77, -13, 38, -45, 93, -9, 34, 15, -3, 61, 25, 78, 63, -12, -19, -70, 25, -36, -5,
13, 96, -44, 30, 2, -7, 6, 17, 16, 51, 26, 33, 66, 32, -2, 28, 7, 2, -2, 72
]
}
}
roc bnp_roc {
title: "Baseline NT-proBNP and hospitalisation within 6 months"
validation: apparent
n: 100
events: 30
series bnp_scores {
label: "NT-proBNP, pg/mL"
x: [
2950, 130, 1080, 2760, 4420, 1400, 3150, 810, 520, 1210, 2960, 1810, 1960, 2110, 2980, 920, 720, 2070, 1930, 660,
1170, 1360, 1060, 1950, 1680, 1780, 2830, 900, 1400, 5880, 1030, 5130, 710, 1280, 590, 1500, 5930, 1650, 870, 1680,
1640, 1240, 3020, 320, 970, 3840, 640, 610, 710, 570, 1270, 1320, 1530, 2090, 450, 1580, 630, 2190, 790, 820,
790, 480, 840, 990, 1570, 1000, 2220, 650, 1540, 910, 2710, 1340, 2830, 900, 930, 1580, 550, 12900, 3300, 3080,
3830, 550, 2270, 2210, 3020, 560, 5100, 10940, 940, 810, 270, 4560, 370, 1560, 580, 390, 2370, 2880, 400, 3200
]
y: [
0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0,
0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0,
1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0,
0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1
]
}
}
meta updated_meta {
title: "Updated meta-analysis: remote monitoring in heart failure"
measure: hr
scale: log
model: hksj
estimate aldous_2016 { label: "Aldous 2016" point: 0.88 lo: 0.70 hi: 1.10 n: 1120 }
estimate brandt_2018 { label: "Brandt 2018" point: 0.79 lo: 0.61 hi: 1.02 n: 860 }
estimate castell_2019 { label: "Castell 2019" point: 0.95 lo: 0.72 hi: 1.25 n: 710 }
estimate dumont_2021 { label: "Dumont 2021" point: 0.71 lo: 0.52 hi: 0.97 n: 540 }
estimate eze_2023 { label: "Eze 2023" point: 0.84 lo: 0.63 hi: 1.12 n: 650 }
estimate this_trial { label: "This trial" point: 0.56 lo: 0.34 hi: 0.93 n: 100 }
}
view survival_curves: km(primary_endpoint)
view walk_distance: raincloud(walk_change)
view biomarker_roc: roc(bnp_roc)
view meta_forest: forest(updated_meta)
panel figure_2 {
title: "Figure 2. Primary outcome, functional capacity, prognostic biomarker and the trial in context"
rows: 3
cols: 2
width: 180 mm
label_style: lowercase-bold
}
panel panel_a {
view: survival_curves
row: 1
col: 1
col_span: 2
caption: "Kaplan–Meier estimates of time to first heart-failure hospitalisation or cardiovascular death, with numbers at risk"
}
panel panel_b {
view: walk_distance
row: 2
col: 1
caption: "Change in six-minute walk distance at 12 weeks; every patient is shown"
}
panel panel_c {
view: biomarker_roc
row: 2
col: 2
caption: "Discrimination of baseline NT-proBNP for hospitalisation within 6 months (apparent, not validated)"
}
panel panel_d {
view: meta_forest
row: 3
col: 1
col_span: 2
caption: "Random-effects meta-analysis of this trial with five earlier trials (Hartung–Knapp–Sidik–Jonkman interval)"
}
view figure: panel(figure_2)