How to add hovering annotations in matplotlib

I am using matplotlib to make scatter plots. Each point on the scatter plot is associated with a named object. I would like to be able to see the name of an object when I hover my cursor over the point on the scatter plot associated with that object. In particular, it would be nice to be able to quickly see the names of the points that are outliers. The closest thing I have been able to find while searching here is the annotate command, but that appears to create a fixed label on the plot. Unfortunately, with the number of points that I have, the scatter plot would be unreadable if I labeled each point. Does anyone know of a way to create labels that only appear when the cursor hovers in the vicinity of that point?

How to provide a reproducible copy of your DataFrame with to_clipboard()

2018-09-18_reproducible_dataframe.ipynb This question was previously marked as a duplicate of How to make good reproducible pandas examples. Go to that question if you need to make synthetic (fake) data to share. The other question and associated answers cover how to create a reproducible dataframe. They do not cover how to copy an existing dataframe with … Read more