About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2008

URL: http://cxc.harvard.edu/chips4.1/get_label.sl.html
AHELP for ChIPS 4.1

get_label

Context: sl.chips

Synopsis

Retrieves the attribute value(s) of the label.

Syntax

get_label();
get_label(id [,attribute]);

Description

  • id - an optional ChipsId structure containing values to modify the currency state for the command or a string id to specify a label within the current frame.
  • attribute - a string containing the name of the attribute to retrieve

The get_label command returns a structure containing all the attribute values of the label. To retrieve the value of a specific attribute, provide the attribute name and the id or ChipsId of the object.

Some values are set to "None" in the returned structure. These entries generally correspond to attributes which may only be modified at creation time, such as the object id.

The attributes associated with labels are:

Attribute Description
angle Angle at which the label is drawn
color Color of the label text string
depth Integer value indicating label depth
font font for label text
fontstyle style of the label text
halign Horizontal location of the label
size Font size of the label
valign Vertical location of the label

Note that the label text is not included in the attributes. In order to get that value, use the get_label_text command.

To see if a label is hidden or visible, use the get_label_visible command.

Advanced Functions

The module of advanced ChIPS functions contains other commands for retrieving attribute values (refer to "ahelp chips" for information on loading the module):

get_label_angle
get_label_color
get_label_depth
get_label_font
get_label_fontstyle
get_label_halign
get_label_size
get_label_valign

Example 1

chips> add_label(.4, .8, "C_6H_{12}O_6");
chips> print(get_label());
chips> print(get_label("lbl1","font"));

A label is created and becomes current. Calling get_label with no argument returns all the attributes of the object. get_label is called a second time to return just the "font" attribute.

Example 2

chips> add_label(.4, .8, "C_6H_{12}O_6");
chips> add_label(.4, .9, "x_1 * x_1 = x_1^2", "color=green");
chips> print(get_label("lbl1"));

Two labels are created. get_label is called with the id of the first label, returning all attributes.

Example 3

chips> id=ChipsId();
chips> id.label="lbl1";
chips> print(get_label(id));

A ChipsId structure is created and the id.label field is set to "lbl1". get_label is called with the ChipsId.

Example 4

chips> lblatt=get_label;
chips> print(lblatt);

Retrieve a structure containing the attribute values of the current label and store the results in "lblatt". Print the contents of "lblatt".

Bugs

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

Last modified: December 2008



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.