2
$\begingroup$

When I plot a curve using ContourPlot, and then move the cursor near the plotted line, a pop-up window (tooltip) with the corresponding function formula appears.

Very often I find it distracting, especially when the pop-up window is large and I want to get the coordinates.

How can I disable this?

$\endgroup$

2 Answers 2

4
$\begingroup$

In ContourPlot, ContourLabels -> None.

$\endgroup$
5
  • $\begingroup$ And can I disable this after I have done my plot? $\endgroup$
    – Agnieszka
    Sep 5, 2017 at 8:47
  • 1
    $\begingroup$ @Agnieszka Try replacing Tooltip with (#&) in the output (see ReplaceAll). $\endgroup$
    – Szabolcs
    Sep 5, 2017 at 8:48
  • $\begingroup$ Sorry, but I don't understand your last comment. Assume that I have plotted ContourPlot[x^2+y^2==1,{x,-1,1},{y,-1,1}]. What should I do afterwards to prevent pop-up window? $\endgroup$
    – Agnieszka
    Sep 5, 2017 at 8:52
  • 3
    $\begingroup$ Did you look up ReplaceAll? plot /. Tooltip -> (#&). $\endgroup$
    – Szabolcs
    Sep 5, 2017 at 8:53
  • $\begingroup$ You should read about graphics, see Tooltip (under Scope section in documentation page), ReplaceAll, and pure functions to understand why this works. I am assuming you already know that everything is an expression. $\endgroup$
    – Szabolcs
    Sep 5, 2017 at 8:58
4
$\begingroup$

@Agnieszka
The idea of Szabolcs can be used this way:

p = ContourPlot[x^2+y^2==1,{x,-1,1},{y,-1,1}];
p /. Tooltip -> (#&)

Pavel

$\endgroup$
4
  • $\begingroup$ Same as Szbolcs' comment: mathematica.stackexchange.com/questions/155073/… $\endgroup$
    – Michael E2
    Mar 8, 2020 at 19:53
  • $\begingroup$ Yes, but Agnieszka did not understand his answer. $\endgroup$
    – Pavel
    Mar 9, 2020 at 20:12
  • $\begingroup$ It would be polite to acknowledge Szabolcs' contribution, though, wouldn't it? $\endgroup$
    – Michael E2
    Mar 9, 2020 at 20:16
  • $\begingroup$ Yes, you are right. Thank you for the point. $\endgroup$
    – Pavel
    Mar 10, 2020 at 21:43

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.