Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: what is wrong with this code?
Posted:
Apr 3, 2013 4:07 AM


You're just seeing some artifacts. Increasing the plotpoints gives a better looking plot:
f[x_] := If[EvenQ[IntegerPart[x]], 0.4, 0.8]; Plot[f[x], {x, 1, 101}, PlotRange > {0, 1}, PlotPoints > 69]
BTW, next time try to be a bit more descriptive than just "what's wrong with this", OK?



