contact_map.ConcurrencePlotter

class contact_map.ConcurrencePlotter(concurrence=None, labels=None, x_values=None)[source]

Plot manager for contact concurrences.

Parameters:
  • concurrence (Concurrence) – concurrence to plot; default None allows to override later
  • labels (list of string) – labels for the contact pairs, default None will use concurrence labels if available, integers if not
  • x_values (list of numeric) – values to use for the time axis; default None uses integers starting at 0 (can be used to assign the actual simulation time to the x-axis)
__init__(concurrence=None, labels=None, x_values=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__([concurrence, labels, x_values]) Initialize self.
get_concurrence_labels(concurrence[, labels]) Extract labels for contact from a concurrence object
plot([concurrence]) Contact concurrence plot based on matplotlib

Attributes

x_values values to use for the x-axis (time)
static get_concurrence_labels(concurrence, labels=None)[source]

Extract labels for contact from a concurrence object

If labels is given, that is returned. Otherwise, the concurrence is checked for labels, and those are used. If those are also not available, string forms of integers starting with 0 are returned.

Parameters:
  • concurrence (Concurrence) – concurrence, which may have label information
  • labels (list of string) – labels to use for contacts (optional)
Returns:

labels to use for contacts

Return type:

list of string

plot(concurrence=None, **kwargs)[source]

Contact concurrence plot based on matplotlib

Additional kwargs given here will be passed to the matplotlib Axes.plot() method.

Parameters:concurrence (Concurrence) – optional; default None uses self.concurrence; this allows one to override the use of self.concurrence
Returns:
  • fig (matplotlib.Figure)
  • ax (matplotlib.Axes)
  • lgd (matplotlib.legend.Legend) – objects for matplotlib-based plot of contact concurrences
x_values

values to use for the x-axis (time)

Type:list