Last modified: December 2013

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


AHELP for CIAO 4.11 ChIPS v1

set_attribute

Context: utilities

Synopsis

Sets the attribute value(s) for the specified object.

Syntax

set_attribute(object_type, attributes)
set_attribute(id, object_type, attributes)

Description

The function arguments.

Argument Description
object_type What type of object to modify, such as chips_window or chips_curve; see the Object Type section of "ahelp chipsopt".
attributes Configure object properties by giving an attribute string (a space-separated list of key=value pairs), list, dictionary, or a ChIPS object.

The set_attribute command is used to set one or more values of the attributes of the specified object. Multiple objects of the same type may be modified with a single command by setting the currency to "all".

For general information on specifying attribute values, refer to "ahelp attributes" and "ahelp setget".


Examples

Example 1

chips> set_attribute(chips_curve, "line.style=dot line.thickness=2")

Set the curve line style to dot and the line thickness to 2 for the current curve.

Example 2

chips> set_attribute(chips_curve, "*.color=red")

Sets all color attributes of the current curve to red.

Example 3

chips> set_attribute(chips_curve, "err.*=off")

Sets err.up, err.down, err.left, and err.right to off.

Example 4

chips> set_attribute("crv2", chips_curve, "line.style=dot
line.thickness=2")

Set the curve line style to dot and the line thickness to 2 for the curve called "crv2".

Example 5

chips> set_attribute(chips_plot, ["style", "box"])

Using attribute/value pairs, set the style of the current plot to box.

Example 6

chips> set_attribute(chips_axis, ["*.color", "blue", "*.font", "times"])

Using attribute/value pairs, set all the color and font attributes of the current axes to blue and times respectively.

Example 7

chips> set_attribute(chips_axis, {"*.color": "blue", "*.font": "times"})

This is a repeat of the previous example, using a dictionary rather than a list to define the attributes to change.

Example 8

chips> ctr = ChipsContour()
chips> ctr.color = "red"
chips> ctr.style = "shortdash"
chips> set_attribute("ctr1", chips_contour, ctr)

Populate the "ctr" structure with attribute values, then use it to set ctr1 to be a red, short-dashed contour.


Bugs

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

See Also

concepts
attributes, setget
utilities
get_attribute, set_cascading_property, set_current