Last modified: December 2014

URL: https://cxc.cfa.harvard.edu/chips/ahelp/set_preference.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.11 ChIPS v1

set_preference

Context: preference

Synopsis

Sets the specified preference.

Syntax

set_preference(name, value)

Description

The function arguments.

Argument Description
name The name of the preference setting to change. This can include a wild card when it makes sense, such as "curve.*.color".
value The new value of the setting, as a string.

The set_preference command sets the specified preference to the supplied value. The new setting does not affect the attributes of existing objects and data, only new ones created after the call to set_preference, except for the foreground.display and background.display settings; for these two preferences only, all existing windows will also be updated.

A complete list of supported preferences is available from the set_preferences ahelp page. Use the set_preferences command to change multiple preferences at a time.

Changing the foreground.display and background.display preferences

Changing either, or both, the foreground.display and background.display preference settings changes all existing windows, as well as new ones.


Examples

Example 1

chips> set_preference("point.color", "red")

Set the default point color to red.

Example 2

chips> print(get_preference("point.fill"))
true
chips> add_point(0.1, 0.95, ['coordsys', FRAME_NORM, 'style', 'square'])
chips> set_preference("point.fill", "false")
chips> add_point(0.1, 0.9, ['coordsys', FRAME_NORM, 'style', 'square'])

Ther first point is drawn as a filled square, but the second point is drawn as an open square.

Example 3

chips> set_preference("axis.*.thickness", "2")

Change all the thickness elements of the axis to use a thickness of 2 by default.


Bugs

See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.

See Also

concepts
preferences, setget
preference
get_preference, get_preferences, load_preferences, save_preferences, set_preference_autoload, set_preferences
utilities
set_current