Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've plotted a function that varies with respect to time. It's inside a manipulate box, which can vary the time. And I'd like to display the value of the function at the time on the slider on my plot.

I've seen it done before, but I've been trying unsuccessfully for the last 40 or so minutes to find out how. Any ideas?

share|improve this question
Show us the code you have and maybe someone can help. – bill s Oct 24 '13 at 14:45
up vote 4 down vote accepted

There are many ways to do this, depending on how you want to display the coordinates. The following example displays the coordinates in four ways (other than reading them from the graph itself).

1) The first uses a Text graphics primitive in the Epilog option.

2) The second uses the Tooltip applied to a Point graphics primitive also in the Epilog option. If you hover your mouse over the point, the tooltip will popup displaying the tooltip text (in this case the coordinates).

3) The third uses the PlotLabel option to display the coordinate text.

4) The fourth displays the coordinates outside of the plot altogether in a different cell of a display Grid.

f[x_] := x^2;
 {{t, f[t]}},
 {Plot[f[x], {x, 0, 1}, 
   Epilog -> {PointSize[Large], Red,
              Tooltip[Point[{t, f[t]}], {t, f[t]}],
              Text[{t, f[t]}, {0.3, 0.8}]}, 
   PlotLabel -> {t, f[t]}]}
}], {t, 0, 1}]

Display coordinates of a point on a plot

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.