Figure 7.7 Coordination in space-time paths

figures
code
R

This page shows a different set of ‘flockers’ converging in space-time—in fact the same ones that are used on the ‘make your own cover’ page. I’ve provided two plots here, both in colour, and one an interactive 3D plot so you can have a proper look.

Code
library(dplyr)
library(gg3D)
library(plotly)

flockers <- read.table('traces.csv', sep=' ', header = TRUE)

It’s worth noting that plotly rescales all the coordinates here (because I ask it to with asp = 1) but that’s probably best for giving a general impression of the patterns.

Code
plot_ly(group_by(flockers, who), 
        x = ~x, y = ~y, z = ~t, color = ~who, colors = "magma",
        type = 'scatter3d', mode = 'lines', asp = 1, lwd = 0.5)