RE: avoid spurious vertical segment in step function plot
- To: mathgroup at smc.vnet.net
- Subject: [mg23367] RE: [mg23327] avoid spurious vertical segment in step function plot
- From: "Higinio Ramos Calle" <higra at gugu.usal.es>
- Date: Thu, 4 May 2000 02:59:34 -0400 (EDT)
- References: <200005020443.AAA29169@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
----- 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
- References:
- avoid spurious vertical segment in step function plot
- From: Murray Eisenberg <murray@math.umass.edu>
- avoid spurious vertical segment in step function plot