I have a simple time series (x, y, t). I have plotted all the points (x,y) on a two-dimensional scatter plot using matplotlib and am able to access the time value for each point by making "t" a label and using mplcursors connect:
labels = data.index
points = plt.scatter(data['Column1'], data['Column2'], color=color)
cursor = mplcursors.cursor(points, hover=2)
cursor.connect("add", lambda sel: sel.annotation.set_text(labels[sel.index]))
I am looking for a way that upon selection of a point, that point as well as the next point in the time series will be highlighted, so the viewer can see where the series is going. I can always put the coordinates of the following point in as a label, but I would like the visual.
You can draw a small circle, e.g. via
plt.scatterat the position of the next point. Appending it tosel.extrastakes care of removing it as soon as the current highlight is removed.