diff --git a/apstools/utils.py b/apstools/utils.py index a9421dd6c..606e24750 100644 --- a/apstools/utils.py +++ b/apstools/utils.py @@ -23,7 +23,6 @@ ~listruns ~object_explorer ~pairwise - ~plot_prune_fifo ~print_snapshot_list ~print_RE_md ~quantify_md_key_use @@ -1301,78 +1300,6 @@ def ipython_shell_namespace(): return ns -def plot_prune_fifo(bec, n, y, x): - """ - find the plot with axes x and y and replot with only the last *n* lines - - Note: this is not a bluesky plan. Call it as normal Python function. - - EXAMPLE:: - - plot_prune_fifo(bec, 1, noisy, m1) - - PARAMETERS - - bec - *object* : - instance of BestEffortCallback - - n - *int* : - number of plots to keep - - y - *object* : - instance of ophyd.Signal (or subclass), - dependent (y) axis - - x - *object* : - instance of ophyd.Signal (or subclass), - independent (x) axis - - DEPRECATED: Will be removed by end of 2020-12. - Use :func:`trim_plot_lines` instead. - Note the order of parameters is different in :func:`trim_plot_lines`. - """ - warnings.warn( - "DEPRECATED: plot_prune_fifo() will be removed" - " in a future release. Use trim_plot_lines() instead." - " Note the order of parameters is different in trim_plot_lines()." - ) - - if n < 0: - raise ValueError( - "must be zero or greater", - f" received {n}") - - for liveplot in bec._live_plots.values(): - lp = liveplot.get(y.name) - if lp is None: - logger.debug(f"no LivePlot with name {y.name}") - continue - if lp.x != x.name or lp.y != y.name: - logger.debug(f"no LivePlot with axes ('{x.name}', '{y.name}')") - continue - - # pick out only the traces that contain plot data - # skipping the lines that show peak centers - lines = [ - tr - for tr in lp.ax.lines - if len(tr._x) != 2 - or len(tr._y) != 2 - or (len(tr._x) == 2 and tr._x[0] != tr._x[1]) - ] - if len(lines) > n: - logger.debug(f"limiting LivePlot({y.name}) to {n} traces") - lp.ax.lines = lines[-n:] - lp.ax.legend() - if n > 0: - lp.update_plot() - return lp - - def select_mpl_figure(x, y): """ get the MatPlotLib Figure window for y vs x @@ -1452,7 +1379,7 @@ def trim_plot_lines(bec, n, x, y): instance of ophyd.Signal (or subclass), dependent (y) axis - (new in release 1.3.5, replaces :func:`plot_prune_fifo`) + (new in release 1.3.5) """ liveplot = select_live_plot(bec, y) if liveplot is None: