Wolfram Computation Meets Knowledge

The Wolfram Language:
Fast Introduction for Programmers

Show additional notes for:
All sections 
Get Started

Options

Notes for Java programmers:

Wolfram Language functions allow an arbitrary number and type of options to be included as arguments in any order. Recreating this functionality in Java requires method overloading, optional classes or other additional programming logic.

Notes for Python programmers:

Wolfram Language options are similar to optional arguments in Python, except that they use -> instead of =, and they support symbolic values.

Many built-in functions have "options" that affect details of their operation or output:

In[1]:=1
Framed[x, Background -> Yellow]
Out[1]=1

Options gives the default options of a function:

In[2]:=2
Options[Framed]
Out[2]=2

Automatic is a common default setting, meaning "make an automatic choice."

Some options are often given as pure functions. Parentheses are needed when you use &

In[3]:=3
Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, ColorFunction -> (Hue[#3/3,.5] &)]
Out[3]=3

Use option:>value to make value be reevaluated every time the option is used.


Which of the following plots has no options?


Which of the following has an option that specifies a green background?


Which of the following graph plots has an option that correctly specifies a disk for rendering vertices?

© 2017 Wolfram. All rights reserved.