MathGroup Archive 2010

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

Search the Archive

Re: Plotting anomaly with a staircase function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114788] Re: Plotting anomaly with a staircase function
  • From: Andy <andyr at wolfram.com>
  • Date: Fri, 17 Dec 2010 03:28:27 -0500 (EST)
  • References: <ieado1$rbs$1@smc.vnet.net> <201012161049.FAA11842@smc.vnet.net>

On 12/16/2010 4:49 AM, Nasser M. Abbasi wrote:
> On 12/15/2010 4:53 AM, rebcabin wrote:
>> Hello -- I was investigating a staircase function derived from a
>> representation of a parametric polyline (concept from Differential
>> Geometry), and found some plotting anomalies. In particular, sometimes
>> the "risers" of the stair steps are slanted instead of the expected
>> vertical. I did some fuzz testing of my function and was unable to
>> find an anomaly numerically amongst a million random inputs. I
>> compared my staircase against a different form built from the Matheamtica
>> built-in UnitStep, and that second form does NOT show the anomaly. I
>> boiled everything down to the smallest possible notebook I could, and
>> would be grateful for advice from the community, if anyone has a
>> moment to look at it. There should be nothing difficult or subtle,
>> here, which makes it all the more puzzling!
>>
>> Notebook posted below.
>>
>> https://docs.google.com/leaf?id=0B4v0MzmZfdm8MWRlYzk3NTEtMDAzZi00YzM4LTkyZTEtYjM2ZjIxMjc4MTFk&hl=en&authkey=CPOwrzA
>>
> I ran your notebook in V 8, and I do not see the anomaly, here is a screen shot:
>
> http://12000.org/tmp/dec_15_2010/stairs.png
>
> --Nasser
>
The anomaly likely arises from a lack of PlotPoints. Plot is typically 
not very good with vertical risers in step functions if the sampling 
points are set to default. Try boosting the number of sample points by 
giving PlotPoints -> 500 or something. This is overkill but will likely 
solve your problem.

-Andy


  • Prev by Date: Re: how to debug existing notebook in workbench?
  • Next by Date: Re: Defining a distribution
  • Previous by thread: Re: Plotting anomaly with a staircase function
  • Next by thread: manipulate time