Skip to content

Flint: Added a select_points_to_remove to the custom plot1d

Valentin Valls requested to merge calib1d into master

This PR have to be restarted from the up-to-date version designed for BLISS 1.11 !5586 (merged)


Related to #3881

This PR added a method select_points_to_remove (plus some fixes) to the custom Plot1D.

As result one can use this API to request the user to remove some points in a curve.

It's a basic helper based on scripting API. It would be better to create a real dedicated widget, if people start to use it seriously.

# Setup the first state
import numpy
f = flint()
p = f.get_plot("curve", unique_name="foo")
x = numpy.linspace(0, 10 * numpy.pi, 100)
y = numpy.sin(x + numpy.pi * 1.5)
p.add_curve_item("x", "y", legend="foo", linewidth=1)
p.set_data(x=x, y=y)

# Request the use to edit the curve
# the interaction can be stopped with ctrl-c or the cross button bellow the plot
p.select_points_to_remove("foo")

# Finally the result can be retrieve
x = p.get_data("x")
y = p.get_data("y")

image

Requested by @berruyer

Edited by Valentin Valls

Merge request reports