How to extract numerical data from a matplotlib scatter plot in python?

I have a scatter plot with about 19,000 data points. By visual inspection, I noticed some points for which I want to look at the corresponding numerical data from the data frame (basically a subset of the original data whose scatter plot we are looking at).

Is there a way to isolate the data corresponding to the point(s) [when the coordinates of the data points are not apparent from the figure] ?

Below is an example. How do I get data corresponding to the circled point on the plot?

Any response would be of great help.

Thanks.

• How about interactive access to points? stackoverflow.com/questions/10655217/… It is easier than bokeh/ plotly, and if combined with annotate mentioned below you get your points of interest. – TwinPenguins Dec 19 '18 at 7:01
• Okay..this is interesting....thanks for sharing @MajidMortazavi. – user62198 Dec 19 '18 at 16:16

You could also show the values for each point by using matplotlibs annotate command:

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(5)
y = np.random.randint(10, size=5)

fig = plt.figure()