OptionValue

OptionValue[name]
gives the value of name in options matched by OptionsPattern.

OptionValue[f, name]
gives the value of name for options associated with the head f.

OptionValue[f, opts, name]
extracts option values from the explicit list of rules opts.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Define default option values for the function :

In[1]:=
Click for copyable input

Define , allowing options to be given:

In[2]:=
Click for copyable input

Use with an explicit option setting:

In[3]:=
Click for copyable input
Out[3]=

Use with options taken to have their default values:

In[4]:=
Click for copyable input
Out[4]=
New in 6
New to Mathematica? Find your learning path »
Have a question? Ask support »