Plot several trajectories from a pandas DataFrame with hover

I’ve got a pandas dataframe with around 3000 rows and 50000 columns, with particle trajectories coming from a simulation. Each pair of adjacent columns are the instantaneous x- and y- coordinate of a particle in a 2D region, and time elapses from top to bottom of the dataframe, using the row number as index.

I would like to be able to plot the trajectories for the dataframe (not just one trajectory, this I’m currently able to do) at once while being able to hover and have the visualisation tell me which particle trajectory I’m over (particles’ ids are in the dataframe column names).

I’ve been through the docs and site of datashader but, although I’ve accomplished visualisation of one trajectory at a time, I cannot find a way to achieve this.

How would you go about accomplishing this with datashader?

I think what you want is similar to this:

Thanks a lot for your help, I’ll dive into it and be back tomorrow. In the meantime, I wonder: could this be done with curves (or paths, I’m not familiar with the terminology yet!)?

Probably; you could replace all instances of scatter to curve.