Ironically using a link_selections
object on a single plot isn’t much longer in terms of code:
df = pd.DataFrame(np.random.randn(50,2))
scatter = hv.Scatter(df.values)
ls = hv.link_selections.instance()
ls(scatter)
Then select values:
ls.filter(df)
There are two advantages with this:
-
ls
doesn’t start out with an empty list - You don’t need to explicitely add the
lasso_select
andbox_select
tool.