Re: problem with plot
- To: mathgroup at smc.vnet.net
- Subject: [mg33356] Re: [mg33327] problem with plot
- From: BobHanlon at aol.com
- Date: Sun, 17 Mar 2002 05:33:07 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 3/16/02 2:17:03 AM, puma at puma.com writes:
>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!
>?????
>
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}];
You need more resolution in the PlotPoint sampling
Options[Plot, PlotPoints]
{PlotPoints -> 25}
Plot[f[16 x],{x,-1,1}, PlotPoints -> 30];
Bob Hanlon
Chantilly, VA USA