|
|
|
|
SynopsisAttributes are used to configure object properties such as color, font, and line style. DescriptionChIPS 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. 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.
l=ChipsLabel();
l.color="darkred";
set_label(l);
Values set to "NULL" have no effect on existing attribute values. 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.
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.
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 AttributesThe module of advanced ChIPS functions contains lower-level commands in ChIPS to set individual object attributes (refer to "ahelp chips" for information on loading the module).
set_curve_linecolor("red");
set_frame_transparency("frm1",True);
These commands are equivalent to using set_<object> with an attribute/value pair. Example 1
chips> add_label(100,100,"Fig. B",{"color", "blue", "size", "8" });Create a blue label, specifying the attribute values in a list. Example 2
chips> add_region({1,1,2,2.32,2},{1.5,2,2,1,1},"fill.style=1
fill.color=blue");
chips> add_region({3,2.67,3},{1,2,2.2},"fill.style=1 fill.color=lime");Add two regions, using an attribute string. Example 3
chips> settings = ChipsFrame;
chips> settings.border.color = "blue";
chips> settings.border.visible = 1;
chips> set_frame("frame1",settings);Populate the "settings" structure with attribute values, then use it to set frame1 to have a blue border Example 4
chips> add_frame(.1, .1, .5, .5);
chips> set_frame({"bgcolor","tan"});
chips> add_frame(.5, .5, .9, .9);
chips> set_frame({"bgcolor","white"});Two frames are created, and the background color of each is set with an individual attribute command. BugsSee the bugs pages on the ChIPS website for an up-to-date listing of known bugs. |
![]() |
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. |