Developing Animated Scatter Plots Simon Cleall PSI conference 2017
Why do we… Collect data over time Present those data as a series of cross sections?
Patient-level data
Linear Interpolation b0 bn
Quadratic Interpolation b0 bn b1
Quadratic Interpolation b0 bn b1
Quadratic Interpolation b0 bn b1
Cubic Interpolation b0 bn b1 b2
Cubic Interpolation b0 bn b1 b2
Requirements for b1,b2 Objective: Gradient of b0-b1 line = Gradient of b2-bn line in previous interval b1 b0 bn b2
Requirements for b1,b2 b1 b0 bn b2 Subjective: Distance b1:b0 and b2:bn drives “curviness”
Implementation: interpolation Create Bezier splines (vs time) for each patient Map interpolated points to equally spaced time values. Step 1 gives equally spaced points in terms of λ not equally spaced on the time axis For Each Measure:
Implementation: plots Subset data to include just “day x” data Create scatter plot save with desired properties Trade-off resolution, image dimensions and file-size For Each Timepoint: Attributes consistent across plots
Implementation: animating System call of ffmpeg