
Plot the model-implied diffusion connectivity matrix (\(\pi_{ij}\))
Source:R/plot_diffusion_pi.R
plot_diffusion_pi.RdDraws a heatmap of the normalized gravity connectivity matrix
\(\pi_{ij}\) (calc_diffusion_matrix_pi), the probability that
a traveler leaving origin \(i\) arrives at destination \(j\). This is the
\(\pi_{ij}\) panel of the "spatial" figure group in
render_MOSAIC_figures.
Usage
plot_diffusion_pi(pi, location_name = rownames(pi), latitude = NULL)Arguments
- pi
Numeric J x J connectivity matrix from
calc_mobility_flux(element$pi), diagonalNA.- location_name
Character vector of length J giving axis labels in the order of
pi's rows/columns. Defaults torownames(pi).- latitude
Numeric vector of length J giving each location's latitude in the row order of
pi; used to order the axes south-to-north (matchingplot_mobility). WhenNULL(default) the axes are left in the order oflocation_name.
Details
The aesthetic matches the published \(\pi\) panel of
plot_mobility exactly (theme_bw(), viridis "G" fill,
bottom colorbar). Axes are ordered south-to-north by latitude via a keyed
factor(levels = ) over the named matrix (values follow their labels);
no positional sort of labels is performed.
This is the model-derived sibling of the observed-OAG \(\pi\) panel in
plot_mobility; the two visualize different quantities (modeled
vs observed) and are intentionally separate.