is there a way i can click a plot so the location i click the plot it will output the value somewhere?

say i have an x vs y plot of a sine wave. I want the location i click along the x axis to be outputted (the time value).

Thanks!