MathGroup Archive 2002

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

Search the Archive

RE: problem with plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33352] RE: [mg33327] problem with plot
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sun, 17 Mar 2002 05:33:02 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

puma,

The second plot fails because the default PlotPoints -> 25, is too coarse to
catch the curve. The initial sample points gave zero everywhere so it
plotted a zero curve. Increasing the PlotPoints will solve the problem. Of
course, the better choice is to use a plot domain that matches the function.

f[x_] := 0 /; x < 0 || x >= 1;
f[x_] := 1 /; x >= 0 && x < 1/2;
f[x_] := -1 /; x >= 1/2 && x < 1;

Plot[f[16x], {x, -1, 1},
    PlotPoints -> 50];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

> From: puma [mailto:puma at puma.com]
To: mathgroup at smc.vnet.net
>
> Please try this:
> <<
> f[x_]:=0 /; x < 0 || x >= 1;
> f[x_]:=1 /; x >= 0 && x < 1/2;
> f[x_]:=-1 /; x >= 1/2 && x < 1;
> Plot[f[16 x],{x,0,1}];
> Plot[f[16 x],{x,-1,1}];
>
> Clear[f];
> >>
> why the curve disappear in the 2nd plot?
> only x-interval is changed!
> ?????
>



  • Prev by Date: Mathematica and Microsoft.net
  • Next by Date: ridiculous results with DSolve
  • Previous by thread: Re: problem with plot
  • Next by thread: Re: problem with plot