silx icon indicating copy to clipboard operation
silx copied to clipboard

Flag curves from fit

Open vallsv opened this issue 2 years ago • 1 comments

One of the annoying issue is that the fit tool creates new items on the plot.

That's not very easy to clean up that.

Up until now i was flagging all the other items in order to identify the remaining onces (most probably only the items from the fit).

Now i think i will filter them by name, if i have some luck.

But, could we think about flagging them by type. For example we could use that stuff. Which BTW also could contain info from the fit at some point.

I guess the result of the fit is always a curve.

class FitCurve(Curve):
    pass

vallsv avatar Jul 27 '23 15:07 vallsv

Here is my workaround for now

        for i in plot.getItems():
            name = i.getName()
            if name is None:
                continue
            # Guess the name of the items created by the fit tool
            if name.startswith("Fit "):
                plot.removeItem(i)

vallsv avatar Jul 28 '23 06:07 vallsv