Skip to content
Advertisement

Display only single line on hover, hide all other lines

Is there is a way to hide all other lines on a figure, when I am hovering a single one?

Example:

JavaScript

will produce:

enter image description here

and I want this, when I hover particular line (but without manually switching off all other lines and keeping X, Y axes dims):

enter image description here

UPD: inside jupyter notebook

Advertisement

Answer

JavaScript

If you are running into issues, here is the jupyter notebook support documentation for using FigureWidget and here is the jupyter lab support documentation. Make sure you have the ipywidgets package installed. Also, just as a FYI, here is the FigureWidget documentation.

When you hover over a marker in the graph.

enter image description here

When you click on any marker of the visible trace all the hidden traces will become visible again.

enter image description here

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement