4
$\begingroup$

How can I show cursor coordinates as I move the mouse over the contour plot in the result displayed by evaluation the following:

Manipulate[
  ContourPlot[91.4 + (91.4 - t) (0.023 v - 0.304 Sqrt[v] - 0.474), 
    {v, 4,  45}, {t, -60, 30}, 
    ContourLabels -> True], 
  {{spot, {30, 15}}, {5, -60}, {45, 25}, Locator}]

Additionally, I would like to show bigger levels.

$\endgroup$
1
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 0) Browse the common pitfalls question 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ Mar 10, 2015 at 5:22

2 Answers 2

8
$\begingroup$

Update: You can also use GetCoordinates from the right-click menu:

f[v_, t_] := 91.4 + (91.4 - t) (0.023 v - 0.304 Sqrt[v] - 0.474);
ContourPlot[f[v, t], {v, 4, 45}, {t, -60, 30}, ContourLabels -> True]

enter image description here

Use CoordinatesToolOptions to customize the content displayed:

ContourPlot[f[v, t], {v, 4, 45}, {t, -60, 30}, ContourLabels -> True, 
 CoordinatesToolOptions -> {"DisplayFunction" -> 
    Function[pt, Row[{"f(", pt[[1]], ",", pt[[2]] ") = ", f @@ pt}]]}]

enter image description here


Original post:

Manipulate[ContourPlot[91.4 + (91.4 - t) (0.023 v - 0.304 Sqrt[v] - 0.474), 
              {v, 4, 45}, {t, -60, 30}, 
              ContourLabels -> True, PlotLabel -> Style[spot, "Panel", 16]],
   {{spot, {30, 15}}, {5, -60}, {45, 25}, Locator}]

or

Manipulate[Labeled[ContourPlot[91.4 + (91.4 - t) (0.023 v - 0.304 Sqrt[v] - 0.474), 
                               {v, 4, 45}, {t, -60, 30}, ContourLabels -> True], 
                   Style[spot, "Panel", 16], Top], 
           {{spot, {30, 15}}, {5, -60}, {45, 25}, Locator}]

to get

enter image description here

$\endgroup$
0
3
$\begingroup$
Manipulate[
 Column@{Dynamic[MousePosition["Graphics", "Mouse not in graphics!"]],
    ContourPlot[91.4 + (91.4 - t) (0.023 v - 0.304 Sqrt[v] - 0.474), {v, 4, 45}, {t, -60, 30}, 
               ContourLabels -> True]}, 
 {{spot, {30, 15}}, {5, -60}, {45, 25}, Locator}]

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ Why not just Dynamic[spot]? $\endgroup$
    – Kuba
    Mar 10, 2015 at 7:54
  • $\begingroup$ @Kuba Because that doesn't follow the mouse position continuously. It is updated only when you click. $\endgroup$ Mar 10, 2015 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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