MathGroup Archive 2003

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

Search the Archive

RE: Mathematica 5 : strange Plot


A common question. You need to use the PlotRange option. The default value
is Automatic, in which case Mathematica picks out what it thinks is the most
"interesting" portion of the graph to display. This does not always satisfy.
You PlotRange -> All to show everything or specify specific plot ranges.
Check out PlotRange in Help for full details.

f[x_] := If [x < 20, 0, x - 20]

Plot[f[x], {x, 0, 100},
    PlotRange -> All];

David Park
djmp at

From: pacotomi [mailto:pacotomi at]
To: mathgroup at

Plot[ ] gives me a perplexing graphic :

let :

f[x_] := If [x < 20, 0, x - 20]

Then, I try :

Plot[f[x], {x, 0, 100}]

curiously, I get a plot with x between 0 and 40 and f(x) between 0 and
80. The x range is false but the y one is right.

What's wrong with this simple notebook ?


  • Prev by Date: Re: What Happens to Garbage in Mathematica?
  • Next by Date: Something really wrong with FindRoot or NDSolve in Mathematica 5.0
  • Previous by thread: Re: Mathematica 5 : strange Plot
  • Next by thread: RE: Mathematica 5 : strange Plot