Don't show line/scatter of category anymore when you unselect it by clicking on legend

For future references, it can be done like this in newer version of hvplot.

df.hvplot.scatter(x='col1', y='col2', by='category').opts(legend_opts={"click_policy": "hide"})
3 Likes