Example:
LogLogPlot[
Interpolation[Table[10^{i, i}, {i, 1, 5}]][x] // Evaluate, {x, 10,
100000}]
InterpolatingFunction::dmval: Input value {2.30277} lies outside the
range of data in the interpolating function. Extrapolation will be used.
This is bad, even if intentional, because the function passed to plot
might be written with the assumption that it will never receive
arguments outside certain bounds.
This looks to me like some kind of bug in the "preprocessing" part of
the LogLogPlot function, since the offending value doesn't show up in
the EvaluationMonitor:
f[x_ /; 10 <= x <= 10^5] = Interpolation[Table[10^{i, i}, {i, 1, 5}]]
[x]
LogLogPlot[f[x], {x, 20, 100000}, EvaluationMonitor:>Print["x = ",
x]]
This suggests that somewhere before the main set of points is
evaluated there is a step which uses the incorrect value. It turns out
that the number in question (2.30277) is equal to Log[10], and playing
around with the lower limit of x we see this is always the case. So,
I'd guess there's some step at which it should be evaluating f[xmin],
but it's actually evaluating f[Log[xmin]].
I'd suggest contacting sup...@wolfram.com in case they're not aware
of this one..
In the meantime, one workaround is to define your function so that it
only evaluates with arguments in the desired range, e.g.:
f[x_ /; 10 <= x <= 10^5] = Interpolation[Table[10^{i, i}, {i, 1, 5}]]
[x]
LogLogPlot[f[x], {x, 20, 100000}, EvaluationMonitor:>Print["x = ", x]]
Cheers,
Peter.
LogLogPlot[
Interpolation[Table[10^{i, i}, {i, 1, 5}]][x] // Evaluate, {x, 10,
100000}] // Quiet
But if you really really don't want to sample outside the specified domain
you could use a ParametricPlot. ParametricPlots appear to always hit the
endpoints and to stay within the domain. In the following I use
Presentations to convert a basic ParametricPlot to a LogLog plot. This is
more work because now we have to specify the ticks and grids (but on the
other hand we get more control of them.) Also, in the ParametricDraw I use a
log10 variable for the domain because we want even sampling over the log
scale not the linear scale.
Needs["Presentations`Master`"]
f[x_] = Interpolation[Table[10^{i, i}, {i, 1, 5}]][x]
basicgraphics = ParametricDraw[{logx, f[10^logx]}, {logx, 1, 5}];
xlogticks =
CustomTicks[Log10, {1, 5, {1} // N, {2, 3, 4, 5, 6, 7, 8, 9}}];
xloggrids = CustomGridLines[Log10, {1, 5, Range[9]}, {GrayLevel[.85]}];
ylogticks =
CustomTicks[Log10, {1, 5, {1} // N, {2, 3, 4, 5, 6, 7, 8, 9}}];
yloggrids =
CustomGridLines[Log10, {1, 5, Range[9]}, {GrayLevel[.85]}];
Draw2D[
{basicgraphics /. DrawingTransform[#1 &, Log10@#2 &]},
AspectRatio -> 1,
Frame -> True,
FrameTicks -> {{ylogticks, ylogticks // NoTickLabels}, {xlogticks,
xlogticks // NoTickLabels}},
GridLines -> {xloggrids, yloggrids},
ImageSize -> 350]
The basicgraphics look like:
{{{}, {}, {Line[{{1., 10.}, {1.00123, 10.0283}, {1.00245,
10.0567}, {1.00491, 10.1136}, {1.00981, 10.2286}, {1.01963,
10.4623}, {1.03926, 10.946}, {1.07851, 11.9816}, ....,
{4.99176, 98121.2}, {4.99451, 98743.5}, {4.99588, 99056.1}, {4.99725,
99369.8}, {4.99863, 99684.4}, {5., 100000.}}]}}}
David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/