| AHELP for CIAO 4.5 ChIPS v1 | set_attribute |
Context: utilities |
Synopsis
Sets the attribute value(s) for the specified object.
Syntax
set_attribute([id,] object_type, values)
Description
- id - an optional ChipsId structure containing values to modify the currency state for the command or a string id to specify the object
- object_type - what type of object to modify, such as chips_window or chips_curve; see the Object Type section of "ahelp chipsopt"
- values - the attribute values to set. They may be specified as an attribute object structure, a list of attribute-value pairs, a dictionary (attribute name as the key) or an attribute string.
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".
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 the same as the previous example but uses a Python dictionary, rather than a list of attribute/value pairs.
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

![[ChIPS Logo]](../imgs/chips_logo_navbar.gif)