MathGroup Archive 1998

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

Search the Archive

Re: Plotting w/o artifacts at discontinuities



Bruce Cohen %FEC wrote:
> 
> 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,
Here is a starter: we split the line where it becomes too steep. A lot
more needs to be done to take account of things like the difference
between perceived slope and calculated slope - and it would be useful
to have the slope size that causes the split to be controled by an
option.

plt=Plot[1/(1+x), {x,-2,1}]

Show[plt/.Line[lst_]:>
Line/@Split[lst,Abs[Divide@@Reverse[#2-#1]]<10^4&]]
		

-- 
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642




  • Prev by Date: Re: a probable bug
  • Next by Date: Re: Does Win98 scandisk work with 3.0?
  • Prev by thread: Re: Plotting w/o artifacts at discontinuities
  • Next by thread: Re: Plotting w/o artifacts at discontinuities