Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

Re: Part 2 of a recent post on Plot and v 5

  • To: mathgroup at
  • Subject: [mg44428] Re: Part 2 of a recent post on Plot and v 5
  • From: Bill Rowe <readnewscix at>
  • Date: Sat, 8 Nov 2003 04:51:08 -0500 (EST)
  • Sender: owner-wri-mathgroup at

On 11/7/03 at 5:16 AM, mjankowski at (Mariusz Jankowski) wrote:

> I used

> Plot[UnitStep[x], {x, -1, 5}];
> and found that Mathematica chose to display the function in the "more 
> interesting" range of -1<=x<=1. 
> My opinion is that an EXPLICITLY given range in any of the graphics commands 
> should not be overridden, under any circumstances. Is there anyone who agrees 
> with me?

Yes, I would agree with you. But, in Mathematica, explicity giving a plot range means adding a PlotRange->{values} directive. You seem to feel you should not have to explicitly specify a PlotRange option in addition to the range implied by {x, 1, 5}. For me, this would create more problems than it solves and I would not like this as a default behavior.

However, it you want Mathematica to behave this way, it is very simple to do so. Simply put either of the following directives in your init.m file.

SetOptions[Plot,PlotRange->All] or
SetOptions[Plot, PlotRange->{All, Automatic}]

Note, this will only affect the Plot command and not other plot functions that behave the same way as Plot. That is, doing this would change Plot but not ListPlot.

In one of his books on programming Mathematica, Roman Maeder develops a package that includes a command to allow all occurances of an option to be set to a specified value. Using that package you could cause the default behaviour of all Plot commands to behave in the way you seem to want.
To reply via email subtract one hundred and nine

  • Prev by Date: Re: Part 2 of a recent post on Plot and v 5
  • Next by Date: Re: Trying to use Mathematica as "word processor" for my math homework
  • Previous by thread: Re: Part 2 of a recent post on Plot and v 5
  • Next by thread: RE: Part 2 of a recent post on Plot and v 5