       Re: Not Plotting Vertical Assymptotes

• To: mathgroup at smc.vnet.net
• Subject: [mg18616] Re: [mg18542] Not Plotting Vertical Assymptotes
• From: "Wolf, Hartmut" <hwolf at debis.com>
• Date: Tue, 13 Jul 1999 01:01:36 -0400
• Organization: debis Systemhaus
• References: <199907100618.CAA02940@smc.vnet.net.>
• Sender: owner-wri-mathgroup at wolfram.com

```Hello Patrick

Patrick McLean schrieb:
>
> 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.
>
Perhaps there is a better method, but a quick fix would be:

In:=
g1=Plot[1/(1-x),{x,0,1},DisplayFunction->Identity]

In:=
g2=Plot[1/(1-x),{x,1,2},DisplayFunction->Identity]

In:=
Show[g1,g2,PlotRange->{{0,2},Automatic},DisplayFunction->\$DisplayFunction]

maybe that helps a little bit (Of course you could forge the idea to a
real program) ....

....ok, e.g. like that:

In:= Unprotect[Plot]

In:=  Plot[f_,{var_Symbol,min_,sing__,max_},opts___]:=
Module[{ranges=Prepend[#,var]&/@Partition[{min,sing,max},2,1], g},
g=Map[Plot[f,#,opts,DisplayFunction->Identity]&,ranges];
Show[g,DisplayFunction->\$DisplayFunction]]

In:= Protect[Plot]

In:= Plot[1/((1-x)(2-x)),{x,0,1,2,3},PlotRange->{All,{-50,50}}]

---your's hw

```

• Prev by Date: Re: trouble with greek letter output to EPS
• Next by Date: Re: Manipulating differential equations
• Previous by thread: Not Plotting Vertical Assymptotes
• Next by thread: Re: Not Plotting Vertical Assymptotes