MathGroup Archive 1998

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

Search the Archive

Re: Plotting w/o artifacts at discontinuities



Hi Bruce,
I hope you are satisfied with a bare minimum, to be elaborated along the
lines of the plot functions say in the graphics package.

In[1]:= nojump[{a_, b_}, {c_, d_}] := Abs[(d - b)/(c - a)] < 5000

In[2]:= splitLine[Line[li_]]:=Line/@Cases[Split[li,nojump],{_,__}]
           splitLine[x_]:=splitLine/@x;

In[3]:= plotNoJumps[fun_,rang_,ops___Rule]:=
         With[{gr=Plot[fun,rang,DisplayFunction->Identity, ops]},
           Show[splitLine[gr],DisplayFunction->$DisplayFunction]]

Jürgen


-----Original Message-----
From: Bruce Cohen %FEC <bic@cgl.ucsf.EDU> To: mathgroup@smc.vnet.net
Subject: [mg12168] [mg12082] Plotting w/o artifacts at discontinuities


>I would like to be able to get plots that do not have artifacts from
>discontinuities without having to know where the problem[s] will be in
>advance.
>
>For example, I would like to be able to say
> Plot[1/(1+x), {x,-2,1}]
>and get a graph without the vertical line at x==-1.  Though
> p1=Plot[1/(1+x), {x,-2,-1}, DisplayFunction->Identity];
> p2=Plot[1/(1+x), {x,-1,1}, DisplayFunction->Identity];
> Show[p1,p2, DisplayFunction->$DisplayFunction]; does the trick, it
>requires my anticipation of the problem at x==1.
>
>
>Thanks.
>
>-Bruce
>        Bruce Cohen                    |  INTERNET: bic@cgl.ucsf.edu
>        Lick-Wilmerding High School    |
>bic@lick.pvt.k12.ca.us
>        755 Ocean Avenue               |  VOICE:    (415) 333-4021
>        San Francisco, CA  94112       |  FAX:      (415) 333-9443 --
>        Bruce Cohen                    |  INTERNET: bic@cgl.ucsf.edu
>        Lick-Wilmerding High School    |
>bic@lick.pvt.k12.ca.us
>        755 Ocean Avenue               |  VOICE:    (415) 333-4021
>        San Francisco, CA  94112       |  FAX:      (415) 333-9443
>




  • Prev by Date: Re: Re: Pattern matching more than once
  • Next by Date: Re: Sqrt problem - restated
  • Prev by thread: Re: Plotting w/o artifacts at discontinuities
  • Next by thread: Re: Plotting w/o artifacts at discontinuities