Plotting utilities

Helper functions used to generate the examples in the Analytical Theory tutorial are contained in the multi_locus_analysis.plotting module. Please see the API docs for details.

Historically, this package’s author has been able to make most plots related to multi locus analysis with a couple of short lines of matplotlib code.

Histograms in Python are not the most elegant, but multi_locus_analysis.finite_window has several methods for representing histograms fairly as smooth (or step) functions that can simply be plotted.

Documentation on how to get around several common issues encountered when plotting (in particular, using colors, colorbars, normalization and facets, can be found in the docs for the external module bruno_util.plotting.

All generally-applicable plotting routines developed within this codebase have been moved to bruno_util, along with their documentation.

Displacement Distributions

The displacement distribution, \(f_{V_i^\delta}(x)\) describes how far (\(x\)) a particle has moved after a given time \(\delta\).

This is a distribution for every value of \(\delta\). Plotting one curve for every value of \(\delta\) is unwieldy:

Note

There will be a plot here, but not made yet.

We provide multi_locus_analysis.plotting.make_all_disps_hist() for quickly plotting subsets of the histograms, comparing to analytical theory, etc. See Displacement Distributions for mathematical details.

Note

There will be a plot here, but not made yet.

Velocity Correlations

Similarly to the displacements distribution, the velocity correlation function \(<V_{ij}^{\delta}(t)\cdot{}V_{ij}^{\delta}(t)>\) is a function for each value of \(\delta\), and so is cumbersome to plot.

We provide multi_locus_analysis.plotting.cvv_plot_sized() to aid in subsampling, weighting the plotted curves visually based on their statistical certainty, and other useful tricks, like comparing to the analytical theory of polymer diffusion as described in our analytical theory tutorial.