Want to customize the hover box for imshow

I am using imshow to display a B&W image. When I hover my mouse over the image, the resulting box shows the x and y coordinates of the image. I have a dictionary that maps the y values found in my image to names. Basically, every row has a name (showing where that row of values was obtained). Can I use this dictionary to change the hover box to show the name that goes with each y value, instead of showing the y value? - Elizabeth