I am a quite new user of matplotlib. When plotting a surface (3D) with matplotlib and plot_surface, a window appears with the graph. In that windows, on the bottom right cor
With ax.format_coord(mouseevent.xdata,mouseevent.ydata)
you get the x, y, z values in a string ('x=0.222, y=0.452, z=0.826')
from which you can extract the values.
For example for y-coordinate:
def gety(x,y):
s = ax.format_coord(x,y)
out = ""
for i in range(s.find('y')+2,s.find('z')-2):
out = out+s[i]
return float(out)