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_valuesvalues to use for the x-axis (time) -
static
get_concurrence_labels(concurrence, labels=None)[source]¶ Extract labels for contact from a concurrence object
If
labelsis given, that is returned. Otherwise, theconcurrenceis 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
- concurrence (
-
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 usesself.concurrence; this allows one to override the use ofself.concurrenceReturns: - fig (
matplotlib.Figure) - ax (
matplotlib.Axes) - lgd (
matplotlib.legend.Legend) – objects for matplotlib-based plot of contact concurrences
- fig (
- concurrence (