Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Plot[] of smooth function results in wildly fluctuating graph?

  • To: mathgroup at
  • Subject: [mg64814] Re: Plot[] of smooth function results in wildly fluctuating graph?
  • From: Peter Pein <petsie at>
  • Date: Sat, 4 Mar 2006 02:35:27 -0500 (EST)
  • References: <du8495$t4g$>
  • Sender: owner-wri-mathgroup at

KvS schrieb:
> Hi everybody,
> I have a problem with Plot[]. In my code I generate a sequence (in k)
> of functions s -> v[k,s] where each of them is piecewise defined on
> [a,Infinity) (a>>0) using v[k,s_]=Evaluate[Boole[a<=s<=x1]*(<formula1>)
> + Boole[x1<s<=x2]*(<formula2>) + ... ]. Each of the formulas on a
> subinterval is of the form
> s^b * \sum_{m=0}^n c[k,m]*(Log[s])^m + linear function
> where b is typically something like 50 or -50 and the n (different for
> the different subintervals) lies somewhere between 0 and k.
> The problem is that after some runs, say when k=20, making a plot of
> this function simply by Plot[v[k,s], {s,a,10}] shows wild fluctuations
> and absurd values in those subintervals where n is big, while directly
> evaluating the function at some points in those subintervals using
> N[..] shows that this function (as expected) is actually smooth and has
> much smaller values than the plot indicates.
> I could of course do soemthing like ListPlot[Table[...]] but that is
> unsatisfactory and just not smooth enough. Is there a way to get Plot[]
> to use a different way of evaluating the function (I guess the error
> must be in there) in order to get a good result?
Hi Kees,

Ted Ersek's PrecisionPlot ( might help.

I sometimes use Plot[f[x]/.x->SetPrecision[xx,50],{xx,0,10}].

Hope that helps,

  • Prev by Date: Re: Ploting a changing constant
  • Next by Date: Re: Unprotecting "I"
  • Previous by thread: Plot[] of smooth function results in wildly fluctuating graph?
  • Next by thread: 3D voronoi problem in mathematica