add wait_until_over option

This commit is contained in:
Noe Brucy
2023-04-26 15:34:47 +02:00
parent afc5f7f9ef
commit 3540c951c4
+6
View File
@@ -1340,6 +1340,7 @@ class Plotter(Aggregator, BaseProcessor):
sigma_err=2.0,
subname_x=None,
subname_y=None,
wait_until_over=None,
**kwargs,
):
"""
@@ -1434,6 +1435,11 @@ class Plotter(Aggregator, BaseProcessor):
self.logger.warning(
"Errorbar may be meaningless when ytransform is used"
)
# Offset to start x when y in over a given value
if wait_until_over is not None:
offset = np.argmax(y > wait_until_over)
x = x - x[offset]
self.plot(x, y, yerr=yerr, xlabel=xlabel, ylabel=ylabel, run=run, **kwargs)