diff --git a/plotting.py b/plotting.py index f66af2b6d0bd006e2ef4ea1c63a21bed8e58bfb6..efafa4221727e7507b204041787d0894d3b67fc8 100644 --- a/plotting.py +++ b/plotting.py @@ -105,6 +105,45 @@ def plot_random_time_series(time, values, signalname=None, number=5): print(".") +def plot_lineages( + irange, + dl, + signals=["volume", "growth_rate"], + show=True, + figsize=(10, 5), + plot_budding_pts=True, + shade_times=None, + shade_colour="gold", +): + """ + Wrapper of plot_lineage to plot a range of idx values. + + Parameters + ---------- + irange: list of int + Indices of dataloader ids to plot. + dl: dataloader instance + Contains data to plot. + + Example + ------- + >>> plot_lineages(arange(1,20), dl, ["flavin"]) + """ + if isinstance(irange, int): + irange = [irange] + for i in irange: + plot_lineage( + dl.ids[i], + dl.df, + signals, + show, + figsize, + plot_budding_pts, + shade_times, + shade_colour, + ) + + def plot_lineage( idx, df,