|
|
|
|
Concepts: AttributesChIPS allows users to control the appearance and behavior of objects - such as windows, curves, lines, contours, and axes - via configurable attribute settings. For instance, labels have a font, color, font size, font style, angle, and alignment attributes. The add_<object> and set_<object> help files have a list of the attributes for each object. The Values concept documentation lists the values various attributs - such as color and line style - can take. Attribute ObjectsAttribute objects are structures for setting and retrieving attribute values of objects. A blank object is created from object constructors, such as ChipsLabel, then the values are set and applied to the object. # Python
l=ChipsLabel()
l.color="darkred"
set_label(l)
l.size=16
add_label(2,10,r"\alpha=3.1\pm0.2",l)
% S-Lang
l=ChipsLabel;
l.color="darkred";
set_label(l);
l.size=16;
add_label(2,10,"\alpha=3.1\pm0.2"R,l)
Values set to "None" (Python) or "NULL" (S-Lang) have no effect on existing the attribute values. As shown, the object syntax may be used when adding a new object or when updating the settings of an existing object. The get_<object> commands return a structure of attributes for the specifed object populated with the current values. Attribute ListsAttribute lists consist of any number of attribute/value pairs. The syntax for the list is: attribute1, value1, attribute2, value2, ... attributeN, valueN. # Python
add_curve(x,y,["line.color", "coral"])
set_curve(["symbol.color","red", "symbol.size",10])
% S-Lang
add_curve(x,y,{"line.color", "coral"});
set_curve({"symbol.color","red", "symbol.size",10});
As shown, the list syntax may be used when adding a new object or when updating the settings of an existing object. If the attribute list is specified during an add_<object> command, it may include attributes for other objects that will be created by the call, e.g. adding a curve will create a plot and axes if they do not exist. Attribute StringsAn attribute string is a space-delimited list of attribute/value pairs which may be used to set values of object attributes. The syntax for the string is: attribute1=value1 attribute2=value2 ... attributeN=valueN. # Python
add_curve(x,y,"axis.color=lime curve.line.color=cornflower")
% S-Lang
add_curve(x,y,"axis.color=lime curve.line.color=cornflower");
The attribute string may only be used in an add_<object> command. It cannot be used to change the properties of an existing object. Individual AttributesThere are also lower-level commands in ChIPS to set individual object attributes. These take the form set_<object>_<name>, such as: # Python
set_curve_linecolor("red")
set_frame_transparency("frm1",True)
% S-Lang
set_curve_linecolor("red");
set_frame_transparency("frm1",1);
These commands are equivalent to using set_<object> with an attribute/value pair. |
![]() |
The Chandra X-Ray
Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA. Email: cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2004. All rights reserved. |