From ae1df1eadd7a34155fb5bf1ef7cf78296d24795e Mon Sep 17 00:00:00 2001 From: Marko Toplak Date: Thu, 26 Sep 2024 23:14:35 +0200 Subject: [PATCH] ImagePlot: do not require exact attribute, just matching names --- orangecontrib/spectroscopy/widgets/owhyper.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/orangecontrib/spectroscopy/widgets/owhyper.py b/orangecontrib/spectroscopy/widgets/owhyper.py index 5a8b8fe1a..5b0fb6a35 100644 --- a/orangecontrib/spectroscopy/widgets/owhyper.py +++ b/orangecontrib/spectroscopy/widgets/owhyper.py @@ -937,18 +937,10 @@ class Result(): pass res = Result() - xat = data.domain[attr_x] - yat = data.domain[attr_y] - - def extract_col(data, var): - nd = Domain([var]) - d = data.transform(nd) - return d.X[:, 0] - progress_interrupt(0) - res.coorx = extract_col(data, xat) - res.coory = extract_col(data, yat) + res.coorx = data.get_column(attr_x.name) + res.coory = data.get_column(attr_y.name) res.data_points = np.hstack([res.coorx.reshape(-1, 1), res.coory.reshape(-1, 1)]) res.lsx = lsx = values_to_linspace(res.coorx) res.lsy = lsy = values_to_linspace(res.coory)