lgca.plots.muller_plot

lgca.plots.muller_plot(root_ID, cum_pop_t, children_nlist, parent_list, timeline, facecolour='identity', facecolour_map=None, cmap=None, norm=None, edgecolour=None, xlabel='Time $k$', ylabel='Relative frequency', title=None, label_map=None, legend_title=None, sort_labels=False, legend_on=False, **kwargs)

Draw a Muller plot from family-tree population data.

Parameters:
  • root_ID (int) – ID of the root family in children_nlist.

  • cum_pop_t (numpy.ndarray) – Cumulative population of all families and descendants with shape (time, families).

  • children_nlist (list) – Nested list of child family IDs indexed by parent family ID.

  • parent_list (list) – Parent family ID indexed by child family ID.

  • timeline (numpy.ndarray) – Timesteps of the simulation.

  • facecolour ({'identity', 'property'} or str or None, default='identity') – Colouring strategy for wedges.

  • facecolour_map (callable or list, optional) – Mapping from family ID to a colour or property value.

  • cmap (str or matplotlib.colors.Colormap, optional) – Colormap used for identity or property colouring.

  • norm (matplotlib.colors.Normalize, optional) – Normalization used for property colouring.

  • edgecolour (str, optional) – Edge colour for wedges. 'align' reuses each wedge face colour.

  • title (xlabel, ylabel,) – Axis labels and title.

  • label_map (callable or list, optional) – Mapping from family ID to legend label.

  • legend_title (str, optional) – Legend or colourbar title.

  • sort_labels (bool, default=False) – If True, sort identity legend labels alphabetically.

  • legend_on (bool, default=False) – Whether to show the legend for identity colouring.

Returns:

(fig, ax, ret, fc_map) where ret is the legend, colourbar or None and fc_map maps family IDs to face colours.