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/add_label.sl.html
AHELP for ChIPS 4.1

add_label

Context: sl.chips

Synopsis

Creates a label.

Syntax

add_label( [ChipsId,] xpos, ypos, text [,attributes]);

Description

  • ChipsId - an optional ChipsId structure containing values to modify the currency state for the command.
  • xpos, ypos - the location of the label; the current coordinate system is used if one is not specified.
  • text - the text of the label. Latex formatting is supported.
  • attributes - optional parameters which allow the user to configure properties though a structure, list, or attribute string.

The add_label command creates a label whose attributes are specified by user preferences or in an attribute list. The new label becomes current by default; providing a ChipsId overrides the currency state.

The position of the label is specified as a coordinate pair (xpos, ypos) in data, pixel, frame, or plot normalized coordinates. Labels specified in data coordinates will only be displayed if the are within the coordinate system range.

Alignment

Alignment attributes control how the text string is situated in relation to the reference position. Horizontal alignment can be specified as left (0), center (.5), right (1), or a numeric ratio of the text length. Vertical alignment is similarly controlled: bottom (0), center (.5), top (1), or a numeric ratio.

Customizing the Label

There are several attributes that control the label characteristics. The attributes can be set to the ChIPS defaults, values provided in the add_label command, or values from the user's preference file.

The attributes may also be modified with the set_label command at any time; see "ahelp set_label" and "ahelp setget" for more information.

The attributes associated with labels are:

Attribute Description Options Default
angle Angle at which the label is drawn -360.0:360.0 0.0
color Color of the text name or hex; see the Color section of "ahelp chipsopt" default
coordsys coordinate system for the label PIXEL, WINDOW_NORM, FRAME_NORM, PLOT_NORM, DATA see "ahelp coordsys"
depth Integer value indicating label depth see the Depth section of "ahelp chipsopt" 100
font text font helvetica|courier|times|greek; see the Font section of "ahelp chipsopt" helvetica
fontstyle style of the label text normal|bold|italic|bolditalic; see the Font Style section of "ahelp chipsopt" normal
halign Horizontal location of the string reference point of the label auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" left
size Font size of the text 1:100 12
stem stem used for label id alphanumeric lbl
valign Vertical location of the string reference point of the label auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" base

Example 1

chips> add_label(.4,.5,"area={\\pi}r^2");

Add a label at position (.4,.5). Latex formatting is used in the label text.

Example 2

chips> settings = ChipsLabel;
chips> settings.color = "blue";
chips> settings.size = 8.0;
chips> settings.stem = "MyLabel";
chips> add_label(100,100,"Figure A",settings);

Populate the "settings" structure with the attribute values, then add the label "Figure A".

Example 3

chips> add_label(100,100,"Fig. B",{"color", "blue", "size", "8" });

Create a blue label, specifying the attribute values in a list.

CHANGES IN CIAO 4.1

coordsys keyword added to attributes

The attribute "coordsys" sets the coordinate system when the object is created. ChipsIds still can be used to set coordinate systems. If a ChipsId and coordsys attribute are both provided, the coordsys value takes precedence.

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.