7
$\begingroup$

I would like to use Callout (Mathematica 11) in a Plot where Evaluated -> True is used.

Plot[x^# & /@ {1, 2, 3}, {x, -10, 10}, Evaluated -> True]

produces a plot with three curves.

But

Plot[Callout[x^#, #] & /@ {1, 2, 3}, {x, -10, 10}, Evaluated -> True]

gives an empty plot.

However,

Plot[{Callout[x, 1], Callout[x^2, 2], Callout[x^3, 3]}, {x, -10, 10}]

works as expected.

Is there an easy way to map Callout over a list of functions in Plot?

$\endgroup$
  • 1
    $\begingroup$ I think "why Evaluated->True fails in this case" is a more interesting question. Look forward to an answer addressing this. $\endgroup$ – xzczd Sep 5 '16 at 14:31
6
$\begingroup$
Module[{x}, Plot[Evaluate[Callout[x^#, #] & /@ {1, 2, 3}], {x, -10, 10}] ]

enter image description here

$\endgroup$
  • $\begingroup$ Nice @Kuba! Plot[Evaluate[Callout[\[FormalX]^#, #] & /@ {1, 2, 3}], {\[FormalX], -10, 10}] works, too. Any idea why? $\endgroup$ – grbl Sep 5 '16 at 10:41
  • $\begingroup$ @grbl why not? :) I put Module just in case. It doesn't do anything but protecting in case of x being assigned outside. $\endgroup$ – Kuba Sep 5 '16 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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