MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Not Plotting Vertical Assymptotes

  • To: mathgroup at
  • Subject: [mg18930] Re: Not Plotting Vertical Assymptotes
  • From: "Allan Hayes" <hay at>
  • Date: Tue, 27 Jul 1999 22:17:29 -0400
  • References: <7m6ivl$>
  • Sender: owner-wri-mathgroup at

Patrick McLean <p_mclean at> wrote in message
news:7m6ivl$2l5 at
> Anyone have any idea how to stop Plot putting a (near) vertical line at
> x=2 in the command:
>       Plot[1/(1-x),{x,0,2}]
> ie. detect that the function 1/(1-x) has a singularity at x=2 and do
> something about it. This is analagous to numerically integrating over a
> (integrable) singularity, where the following remedy works:
>       NIntegrate[1/Abs[Sqrt[x-1]]^2,{x,0,1,2}]
> But in this case it doesn't work. Decreasing MaxBend works a bit but the
> line is still there.
> (I am really interested in drawing paths in the plane using ParmetricPlot)
> Any ideas or comments
> --
> Patrick McLean
> No news is good news...


Here is a way: more work will be needed with ParametricPlot

Using Split we can write a function that operates on Graphics objects and
splits lines at points where the absolute slope gets big,

 DeleteVerticals[gr_Graphics, slopeMax_] :=
 gr /. Line[lst_] :>
       Split[lst, Abs[Divide @@ Reverse[#1 - #2]] < slopeMax &],

Test: some experimentiation to get the right value for slopeMax may be

, 20000]]

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

  • Prev by Date: compiling problem
  • Next by Date: Re: Eigensystems
  • Previous by thread: Re: Not Plotting Vertical Assymptotes
  • Next by thread: Warning messages: Actions not found