This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / The Mathematica Book / A Practical Introduction to Mathematica / Graphics and Sound /

1.9.4 Advanced Topic: Manipulating Options

There are a number of functions built into Mathematica which, like Plot, have various options you can set. Mathematica provides some general mechanisms for handling such options.

If you do not give a specific setting for an option to a function like Plot, then Mathematica will automatically use a default value for the option. The function Options[function, option] allows you to find out the default value for a particular option. You can reset the default using SetOptions[function, option->value]. Note that if you do this, the default value you have given will stay until you explicitly change it.

Manipulating default settings for options.

Here is the default setting for the PlotRange option of Plot.

In[1]:= Options[Plot, PlotRange]

Out[1]=

This resets the default for the PlotRange option. The semicolon stops Mathematica from printing out the rather long list of options for Plot.

In[2]:= SetOptions[Plot, PlotRange->All] ;

Until you explicitly reset it, the default for the PlotRange option will now be All.

In[3]:= Options[Plot, PlotRange]

Out[3]=

The graphics objects that you get from Plot or Show store information on the options they use. You can get this information by applying the Options function to these graphics objects.

Getting information on options used in plots.

Here is a plot, with default settings for all options.

In[4]:= g = Plot[SinIntegral[x], {x, 0, 20}]

Out[4]=

The setting used for the PlotRange option was All.

In[5]:= Options[g, PlotRange]

Out[5]=

AbsoluteOptions gives the absolute automatically chosen values used for PlotRange.

In[6]:= AbsoluteOptions[g, PlotRange]

Out[6]=