Raymond Toy <toy.raymond at gmail.com> writes:
>>>>>> "Rupert" == Rupert Swarbrick <rswarbrick at gmail.com> writes:
>
> Rupert> Raymond Toy <toy.raymond at gmail.com> writes:
> >> This shouldn't be a problem with the current plot2d. It uses an
> >> adaptive plotting algorithm to use more points where the curve is
> >> changing too fast. If, by chance, plot2d tries to evaluate f(1),
> >> maxima catches that error and pretends (I think) that there is a
> >> discontinuity at that point and tries to add more points in the
> >> neighborhood to get a better plot.
> >>
> >> Of course, if the discontinuity is very narrow and the number of
> >> initial sample points is too sparse, plot2d will never see it and hence
> >> never plot it. No surprise there.
> >>
> >> The adaptive plotter isn't used for any other kind of plot such as
> >> parametric plots, unfortunately.
>
> Rupert> Well, at least on my machine,
>
> Rupert> f(x) := signum(x) * abs(x)^(-1/n)$
> Rupert> plot2d(f(x), [x, -1, 1.1]), n=10;
>
> Rupert> displayed the expected behaviour. Maybe I've misunderstood what's going
> Rupert> on.
>
> Ok, I'm not sure what you expect the behavior to be. With our
> example, I see a curve drawn on the y-axis from about y=-2.25 to
> y=2.25. If I change the plot limits to [x, -1,1], I see the same
> curve, except there is no line drawn on the y-axis.
>
> Which of these is your expected behavior? Or were you expecting
> something else?
>
> Ray
My point was this is a (simple) example of a function where we might be
clever enough to spot a point of discontinuity and not join up the
points at "x = -epsilon" and "x = epsilon".
I agree that there's no way to do that with a black-box function, but
most of the time, users will be plotting things like rational functions
so maybe we can do better. I'll have a proper look at the "honest
plotting" paper that Richard Fateman pointed us to before I say much
more though: presumably people have thought about this harder than I!
Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20121106/9990c2d8/attachment-0001.pgp>