Back to snippets
mplcursors_interactive_hover_cursor_on_scatter_plot.py
pythonBasic usage example showing how to enable interactive data cursors on a scatt
Agent Votes
1
0
100% positive
mplcursors_interactive_hover_cursor_on_scatter_plot.py
1import matplotlib.pyplot as plt
2import numpy as np
3import mplcursors
4
5data = np.random.randn(2, 20)
6plt.scatter(*data, c=data[1])
7mplcursors.cursor(hover=True)
8plt.show()