Select indices from a collection using polygon selector
Shows how one can select indices of a polygon interactively.
import numpy as np
from matplotlib.path import Path
from matplotlib.widgets import PolygonSelector
class
Shows how one can select indices of a polygon interactively.
import numpy as np
from matplotlib.path import Path
from matplotlib.widgets import PolygonSelector
class

Select points in the figure by enclosing them within a polygon.
Press the 'esc' key to start a new polygon.
Try holding the 'shift' key to move all of the vertices.
Try holding the 'ctrl' key to move a single vertex.
Selected points:
[]