14
Graphs, flow diagrams, tables and interpretation
This lesson introduces no new epidemic equations or numerical method. It deliberately reuses a familiar SIR scenario so that attention can remain on scientific communication: selecting a diagram, table or graph, then writing an evidence-based biological interpretation with appropriate limitations.
Communication scenario
We compare a baseline SIR epidemic with an intervention that reduces \(\beta\) from 0.30 to 0.12 on day 30.
The task is to communicate the model and results to a reader who needs to understand what was assumed, what changed, what the program calculated and what conclusions are justified.
Four complementary forms of communication
Shows compartments and permitted movements.
Reports outcomes for direct comparison.
Shows change, timing and relationships.
Connects evidence to biology and assumptions.
1. Draw the model structure
\(\beta SI/N\)
\(\gamma I\)
- Boxes represent model states or compartments.
- Arrows represent permitted flows and show their direction.
- Arrow labels state the biological process and mathematical rate.
- A flow diagram shows model structure; it does not show the numerical size of an epidemic.
- Processes omitted from the diagram—such as births or waning immunity—are not present in this model.
2. Choose the right graph for the question
| Question | Useful graph | Why |
|---|---|---|
| How do all compartments change? | One time-series panel containing \(S(t),I(t),R(t)\) | Shows population movement and epidemic phases. |
| How does intervention alter infectious burden? | Baseline and intervention \(I(t)\) curves on the same axes | Supports direct comparison using a common scale. |
| How do peak and final outcomes differ? | Grouped bar chart or exact table | Summarises selected quantities rather than full trajectories. |
| When does the intervention begin? | Vertical reference line at the intervention time | Connects a parameter change to the trajectory timeline. |
Graph-design rules
A difficult graph
- Missing axis labels or units
- Unexplained colours
- Different scales used for a visual comparison
- Too many overlapping curves
- Title merely says “Graph”
- Interpretation based on visual impression alone
A useful graph
- Specific title
- Named axes with units
- Readable legend
- Consistent scales
- Reference lines explained
- Exact outcomes also available in a table
3. Design an outcome table
A table should state the quantity, unit and precision. It should not display unnecessary decimal places.
| Scenario | Peak infectious (people) | Peak time (days) | Outbreak infections (people) |
|---|---|---|---|
| Baseline | Calculated by code | Calculated by code | Calculated by code |
| Day-30 intervention | Calculated by code | Calculated by code | Calculated by code |
Round values only for presentation. Retain the unrounded arrays and outcome values for later calculations.
Run the complete communication example
Output
Run the code to see the result.
Understand the table code
| Code | Technical meaning |
|---|---|
pd.DataFrame({...}) | Creates a labelled rectangular table from columns of equal length. |
[expression for item in values] | A list comprehension that creates one table entry for every scenario. |
table["column"] | Selects one named table column. |
.round(2) | Creates a displayed version rounded to two decimal places. |
.to_string(index=False) | Formats the table as text and hides the automatic row index. |
.to_numpy() | Converts a table column into a NumPy array for plotting. |
.tolist() | Converts values into an ordinary Python list. |
Understand the multi-panel figure
| Code | Purpose |
|---|---|
fig, axes = plt.subplots(1, 3) | Creates one figure containing one row of three plotting areas. |
axes[0] | Selects the first plotting area; indexing begins at zero. |
linestyle="--" | Uses a dashed line, allowing curves to differ by more than colour. |
axvline(30) | Adds a vertical reference line at day 30. |
np.arange(len(labels)) | Creates numerical horizontal positions for the scenario categories. |
bar(...) | Displays outcome categories as rectangular bars; exact values remain in the table. |
fig.suptitle(...) | Adds a title applying to the whole figure. |
fig.tight_layout() | Adjusts spacing to reduce overlap among labels and panels. |
4. Interpret the evidence systematically
Identify the direction and magnitude using the table.
Describe the relevant curve and timing.
Connect the pattern to flows and parameters.
State limitations and avoid causal overclaiming.
Example interpretation structure: “Under the stated SIR assumptions, reducing \(\beta\) on day 30 lowers the modelled infectious peak and cumulative outbreak infections relative to the baseline. The reduction occurs because the infection flow \(\beta SI/N\) becomes smaller after the intervention. The magnitude depends on the assumed parameter change, timing, homogeneous mixing and fixed recovery rate.”
Description is not interpretation
Description only
“The blue line goes up and then comes down. The dashed line is lower.”
This reports appearance without identifying quantities, numerical evidence, mechanism or assumptions.
Biological interpretation
“The infectious population first increases because infection exceeds recovery. After susceptible depletion weakens infection, recovery dominates and the curve declines. The day-30 reduction in \(\beta\) lowers subsequent infection flow, producing a smaller modelled burden.”
Accessibility and reproducibility
- Label every axis and include units.
- Use readable font sizes.
- Do not rely only on colour; use line styles or markers.
- Use the same axis scale for direct comparisons.
- Explain reference lines and shaded regions.
- Provide exact values in a table when precision matters.
- State parameter values and initial conditions.
- Keep the code and model version used to create the figure.
- Give figures and tables informative captions.
- Do not crop axes in ways that exaggerate differences.
What must not be concluded
A deterministic scenario graph does not prove that an intervention caused a real-world reduction. It shows what the specified model predicts under its equations, parameters, initial conditions and intervention assumptions.
Try redesigning the communication
Change the intervention day from 30 to 50 in the intervention scenario and update the vertical reference line.
- Run the model and inspect the outcome table.
- Decide whether the intervention begins before or after the baseline peak.
- Rewrite the example interpretation using the new evidence.
- Give the figure a new informative overall title.
- Check that the diagram, table, graph and written interpretation remain mutually consistent.