Highlighting the artist upon selection

Just pass highlight=True to cursor.

import numpy as np
import matplotlib.pyplot as plt
import mplcursors

x = np.linspace(0, 10, 100)

fig, ax = plt.subplots()

# Plot a series of lines with increasing slopes.
lines = []
for i in range(1, 20):
    line, = ax.plot(x, i * x, label=f"$y = {i}x$")

mplcursors.cursor(lines, highlight=True)


Gallery generated by Sphinx-Gallery