MathGroup Archive 2000

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

Search the Archive

RE: avoid spurious vertical segment in step function plot


----- Original Message -----
From: Murray Eisenberg <murray at math.umass.edu>
To: mathgroup at smc.vnet.net
Subject: [mg23367] [mg23327] avoid spurious vertical segment in step function plot


> Several packages available from MathSource deal with eliminating the
> spurious parts of plots of discontinuous functions across vertical
> asymptotes.
>
> Is there some simple way of dealing with the similar problem of
> eliminating the spurious vertical line segment in plotting a function
> with jumps -- for example, in the following?
>
>   Plot[UnitStep[x], {x, -1, 1}]
>
> --
> Murray Eisenberg                     murray at math.umass.edu
> Mathematics & Statistics Dept.       phone 413 549-1020 (H)
> Univ. of Massachusetts                     413 545-2859 (W)
> Amherst, MA 01003-4515


I  have taken the function UnitStep[x-1] instead UnitStep[x] because in the
last case the vertical line is coincident with the y-axis.
The idea is to plot the function a little before the problematic point
 where exists a vertical asymptote) and a little after this point.

dib1=Plot[UnitStep[x-1], {x, 0, .99999},PlotStyle->RGBColor[1,0,0],
    DisplayFunction->Identity];

dib2=Plot[UnitStep[x-1], {x, 1.00001, 2},PlotStyle->RGBColor[1,0,0],
    DisplayFunction->Identity];

Show[{dib1,dib2},DisplayFunction->$DisplayFunction]

H. Ramos



  • Prev by Date: Simple Mathematica expression Q
  • Next by Date: RE: Follow-up on Do[] Question
  • Previous by thread: avoid spurious vertical segment in step function plot
  • Next by thread: Re: avoid spurious vertical segment in step function plot