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/add_line.py.html
AHELP for ChIPS 4.0 add_line Context: py.chips

Synopsis

Creates a line segment.

Syntax

add_line( [ChipsId,] x1, y1, x2, y2 [,attributes])
add_line( [ChipsId,] xvals, yvals, [,attributes])

Description

  • ChipsId - an optional ChipsId structure containing values to modify the currency state for the command.
  • x1, y1, x2, y2 - the endpoints of the line segment, (x1,y1) and (x2,y2); the current coordinate system is used if one is not specified.
  • xvals, yvals - arrays of x and y coordinates to create a polyline from (xvals[0],yvals[0]) to (xpos[n], yvals[n])
  • attributes - optional parameters which allow the user to configure properties though a structure, list, or attribute string.

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

The endpoints of the line can be specified in data, pixel, frame, or plot normalized coordinates. Lines specified in data coordinates will be clipped at plot boundaries. The "extend" attribute enables lines which extend to infinity.

Customizing the Line

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

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

The attributes associated with lines are:

Attribute Description Options Default
color line color see the Color section of "ahelp py.chips chipsopt" default: white in the ChIPS window, black on printout
depth Integer value indicating line depth see the Depth section of "ahelp py.chips chipsopt" 100
extend Should the line extend to infinity (segment vs ray) see the Line Extend section of "ahelp py.chips chipsopt" none
stem stem used for line id alphanumeric line
style stipple pattern used to draw the line segment see the Line Style section of "ahelp py.chips chipsopt" chips_solid
thickness line thickness see the Thickness section of "ahelp py.chips chipsopt" 1

Example 1

chips> add_line(.1,.1,.9,.9)

Add a diagonal line extending from (.1,.1) to (.9,.9) in the current coordinate system.

Example 2

chips> settings = ChipsLine()
chips> settings.color = 'blue'
chips> settings.thickness = 0.5
chips> settings.stem = 'MyLine'
chips> add_line(100,100,200,150,settings)

Populate the "settings" structure with the attribute values, then add a line segment from (100,100) to (200,150).

Example 3

chips> add_line([.1,.5,.9],[.9,.2,.7],['color', 'blue', 'style', 'dot'])

Create a blue dotted line comprised of two segments, specifying the attribute values in a list.

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.