add exclude range to fit limits (#237)
All checks were successful
Build AppImage / Explore-Gitea-Actions (push) Successful in 1m43s

Co-authored-by: Dominik Demuth <dominik.demuth@physik.tu-darmstadt.de>
Reviewed-on: #237
This commit is contained in:
2024-02-07 17:55:07 +00:00
parent 567148b7e6
commit 40746bfa7c
5 changed files with 24 additions and 5 deletions

View File

@ -511,13 +511,16 @@ class UpperManagement(QtCore.QObject):
_x = data_i.x
# options for fit limits 'none', 'x', ('in', custom region), ('out', excluded region)
if fit_limits == 'none':
inside = slice(None)
elif fit_limits == 'x':
x_lim, _ = self.graphs[self.current_graph].ranges
inside = np.where((_x >= x_lim[0]) & (_x <= x_lim[1]))
elif fit_limits[0] == 'in':
inside = np.where((_x >= fit_limits[1][0]) & (_x <= fit_limits[1][1]))
else:
inside = np.where((_x >= fit_limits[0]) & (_x <= fit_limits[1]))
inside = np.where((_x < fit_limits[1][0]) | (_x > fit_limits[1][1]))
try:
if isinstance(we, str):