WOLFRAM

SetOptions[s,name1value1,name2value2,]

sets the specified default options for a symbol s.

SetOptions[stream,] or SetOptions["name",]

sets options associated with a particular stream.

SetOptions[object,]

sets options associated with an external object such as a NotebookObject or CloudObject.

Details

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Change the style for plots to dashed curves:

Out[6]=6

Restore the system default:

Scope  (4)Survey of the scope of standard use cases

Reset the default precision for HilbertMatrix:

Out[15]=15

Now HilbertMatrix uses machine numbers by default:

Out[18]=18

A specific option setting overrides the new default:

Out[19]=19

Restore the system default:

Start writing to a temporary file:

Out[1]=1

Set the page width to 10 characters:

Out[2]=2

Write Range[10] to the file and close the stream:

Out[3]=3

Line breaks occur at the 10th column:

Create a reference to the input cell:

Out[1]=1

Change the background of the cell to red:

Restore the setting of the cell, which will cause it to inherit from the notebook:

Change the Permissions of a CloudObject:

Out[1]=1
Out[2]=2

Properties & Relations  (2)Properties of the function, and connections to other functions

SetOptions can be used to modify protected symbols:

The option has been modified:

Out[2]=2

The symbol still has attribute Protected:

Out[3]=3

Restore the system default:

SetOptions resets the Permissions value entirely (except for the owner's permissions):

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

SetPermissions only resets the capabilities of the given user groups:

Out[5]=5
Out[6]=6

Possible Issues  (2)Common pitfalls and unexpected behavior

SetOptions can only be used to change the default value of an option, not to add a new one:

Out[1]=1
Out[2]=2

Use AppendTo, PrependTo and similar functions to add additional options to a function:

Out[3]=3

For notebook options with rules, it can be awkward to make a targeted change to a specific rule:

CurrentValue provides a better way of adding or changing specific rules:

Out[2]=2
Wolfram Research (1988), SetOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/SetOptions.html (updated 2012).
Wolfram Research (1988), SetOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/SetOptions.html (updated 2012).

Text

Wolfram Research (1988), SetOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/SetOptions.html (updated 2012).

Wolfram Research (1988), SetOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/SetOptions.html (updated 2012).

CMS

Wolfram Language. 1988. "SetOptions." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/SetOptions.html.

Wolfram Language. 1988. "SetOptions." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/SetOptions.html.

APA

Wolfram Language. (1988). SetOptions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetOptions.html

Wolfram Language. (1988). SetOptions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SetOptions.html

BibTeX

@misc{reference.wolfram_2025_setoptions, author="Wolfram Research", title="{SetOptions}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/SetOptions.html}", note=[Accessed: 25-March-2025 ]}

@misc{reference.wolfram_2025_setoptions, author="Wolfram Research", title="{SetOptions}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/SetOptions.html}", note=[Accessed: 25-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_setoptions, organization={Wolfram Research}, title={SetOptions}, year={2012}, url={https://reference.wolfram.com/language/ref/SetOptions.html}, note=[Accessed: 25-March-2025 ]}

@online{reference.wolfram_2025_setoptions, organization={Wolfram Research}, title={SetOptions}, year={2012}, url={https://reference.wolfram.com/language/ref/SetOptions.html}, note=[Accessed: 25-March-2025 ]}