1
$\begingroup$

If you run this:

LogLogPlot[Echo[x], {x, 10000, 100000}, WorkingPrecision -> 10]

You will see the first evaluation point is at a very very large number E^10000, way outside the plot domain:

enter image description here

But the problem I'm running into is that my function is such that the larger the input, the more time it takes to complete evaluation. Therefore, for most of my real cases, the plotting never completes.

How do I tell LogLogPlot not to try to plug in numbers way outside the domain of the plot?

$\endgroup$
  • $\begingroup$ Why use Echo?? This has nothing to do with plotting the variable. $\endgroup$ – David G. Stork Aug 23 '18 at 0:11
  • $\begingroup$ It indicates what values of x are being plugged in, right? $\endgroup$ – QuantumDot Aug 23 '18 at 4:21
  • $\begingroup$ Exactly. Why would you need to use Echo? $\endgroup$ – David G. Stork Aug 23 '18 at 5:22
0
$\begingroup$

I really don't know why E^10000 is evaluated first. I'd say this might be a bug and might be worthwhile to be reported to Wolfram Support.

Here a workaround: You can write a wrapper for your function so that it gets evaluated only if arguments with the correct size are submitted.

ClearAll[f];
a = 10000;
b = 100000;
f[x_?(a < # < b &)] := x
LogLogPlot[Echo[f[x]], {x, a, b}, WorkingPrecision -> 10]
$\endgroup$

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.