Subject: plot2d(1/x,[x,0,1],[y,0,5]); => division by 0
From: Felix E. Klee
Date: Thu, 17 Apr 2003 17:35:37 +0200
On Thursday 17 April 2003 17:02, Raymond Toy wrote:
> None that I know of. All you can do right now is to change [x,0,1] to
> [x,eps,1] for some suitably small non-zero eps.
>
> We could, however, change the plotting routine so that the end-points
> are never evaluated. That's what quadpack does.
Surely this would work if the singularities are at the endpoints. But what
if plot2d steps on singularities in between? To solve this problem, I
recommend the way Mathematica handles it: Plot just ignores values it can't
evaluate and returns warnings instead. Unfortunately I couldn't come up
with an example that deals with singularities, but I was able to forge an
example that involves complex numbers:
In[1]:= Plot[UnitStep[x]I + x, {x, -1, 1},
PlotRange -> {{-1, 1}, {-1, 1}}];
Plot::plnr: UnitStep[x]I+x is not a machine-sized real number at
x=0.83662...
...
Out[1]:= - Graphics -
Felix
--
To contact me in private don't reply but send email to
felix DOT klee AT inka DOT de