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 2007

URL: http://cxc.harvard.edu/chips4.0/set_label.py.html
AHELP for ChIPS 4.0 set_label Context: py.chips

Synopsis

Modifies the attributes of an existing label.

Syntax

set_label([id,] values)

Description

  • id - an optional ChipsId structure containing values to modify the currency state for the command or a string id to modify a label within the current frame.
  • values - a list containing attribute value pairs or a ChipsLabel object.

The set_label command sets the specified attributes to the provided values. The modified label becomes current. Multiple labels may be modified with a single command by setting the currency to "all".

Customizing the Label

There are several attributes that control the characteristics of labels. The set_label command may be used to modify the attribute values of an existing label at any time during a ChIPS session. See "ahelp py.chips attributes" and "ahelp py.chips setget" for more general information.

If multiple attributes are being set simultaneously and one of them fails, the entire command will fail and the label will not be modified.

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 label text string see the Color section of "ahelp py.chips chipsopt" default
depth Integer value indicating label depth see the Depth section of "ahelp py.chips chipsopt" 100
font font for label text see the Fonts section of "ahelp py.chips chipsopt" helvetica
fontstyle style of the label text see the Font Style section of "ahelp py.chips chipsopt" normal
halign Horizontal location of the string reference point of the label see the Text Alignment section of "ahelp py.chips chipsopt" left
size Font size of the label 1:100 12
valign Vertical location of the string reference point of the label see the Text Alignment section of "ahelp py.chips chipsopt" base

These individual commands are also available for setting attribute values:

set_label_angle
set_label_color
set_label_depth
set_label_font
set_label_fontstyle
set_label_halign
set_label_size
set_label_text
set_label_valign

Example 1

chips> set_label(["color","plum", "size", 16])

Using attribute/value pairs, set the label color to plum and font size to 16.

Example 2

chips> settings = ChipsLabel()
chips> settings.color = 'blue'
chips> settings.angle = 45
chips> settings.font = 'greek'
chips> set_label('lbl1',settings)

Populate the "settings" structure with the attribute values, then use it to set lbl1 to have blue text in the greek font at a 45 degree angle.

Example 3

chips> class labprop:
chips> def __init__(self):
chips> self.color='lime'
chips> self.fontstyle='italic'
chips> set_label(labprop())

Create a user-defined structure with color and fontstyle fields. Use the structure to modify the values of the current label.

Bugs

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

Last modified: December 2007



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.