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

add_line

Context: sl.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 set_line" and "ahelp setget" for more information.

The attributes associated with lines are:

Attribute Description Options Default
color line color name or hex; see the Color section of "ahelp chipsopt" default: white in the ChIPS window, black on printout
coordsys coordinate system for the line PIXEL, WINDOW_NORM, FRAME_NORM, PLOT_NORM, DATA see "ahelp coordsys"
depth Integer value indicating line depth see the Depth section of "ahelp chipsopt" 100
extend Should the line extend to infinity (segment vs ray) see the Line Extend section of "ahelp 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 chipsopt" chips_solid
thickness line thickness 0.5 to 10.0; see the Thickness section of "ahelp 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 = 8.0;
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.

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.

Fix to id assignment

An id specified in the attribute list during an add_line call would not be used, resulting in lines with autogenerated ids.

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.