0

Let's consider very simple data:

x = [1, 2, 3]
y = [2, 3, 4]

To make a plot of this data we just need to run this banal command:

import matplotlib.pyplot as plt`
plt.plot(x, y, "o")
plt.show()

The output of this code is a simple graph. However, my desired graph would be the one, that I can point with a mouse cursor to the point at the graph, and it will tell me its coordinates.

For example, if I point with the mouse cursor at the left bottom corner point, I would like to have next to it the information (1, 2), and if I point with the mouse cursor to the right bottom corner point, I would like to get (3, 4). It is possible to achieve it in matplotlib?

enter image description here

John
  • 1,849
  • 2
  • 13
  • 23

0 Answers0