When you use imshow to plot an image in the bottom right corner of the window the coordinates of the cursor show up. However when I try to set the ticks and tick labels of the axes the window stops displaying coordinates and only displays "x= y="
import matplotlib.pyplot as plt
import numpy as np
d = np.random.rand(100, 100)
fig = plt.figure()
ax = plt.gca()
# If I comment this I get coordinates in the bottom right,
# but after setting the ticks I only get "x= y="
ax.set_xticks([0, 25, 50, 75, 100])
ax.set_xticklabels([0, 0.25, 0.5, 0.75, 1])
ax.set_yticks([0, 25, 50, 75, 100])
ax.set_yticklabels([0, 0.25, 0.5, 0.75, 1])
This displays a random map of data and sets the tick labels to be from 0 to 1, but the cursor coordinates in the bottom right only shows "x= y=".
Is there any way to get the coordinates to show up in the new units defined by the ticks? I think it has something to do with setting the transform for the axes but I can't figure it out.