silx
silx copied to clipboard
Flag curves from fit
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
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)