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 2006

URL: http://cxc.harvard.edu/ciao3.4/chips_line.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 chips_line Context: chips

Synopsis

Adds a line to a drawing area.

Syntax

Integer_Type chips_line(x1,y1,x2,y2)
Integer_Type chips_line(x1,y1,x2,y2,color)
Integer_Type chips_line(x1,y1,x2,y2,color,width)
Integer_Type chips_line(x1,y1,x2,y2,color,width,style)

Description

This is a S-Lang version of the ChIPS LINE command. It draws a line from (x1,y1) to (x2,y2) in the current pane, and the optional parameters control the color, width, and linestyle. If a parameter is not specified, the value from the ChIPS state object is used instead.

The function returns a 0 on success and -1 on failure.

Arguments for chips_line

Name Type Default Comment
x1 Numeric start of line
y1 Numeric start of line
x2 Numeric end of line
y2 Numeric end of line
color Integer_Type chips.linecolor
width Numeric chips.linewidth
style Numeric chips.linestyle

The routine prints a usage message if used with the wrong number of arguments:

  chips> chips_line(1)
  Usage: chips_line(x1,y1,x2,y2[,color[,width[,style]]])
  chips_line(1);

Example 1

  chips> clear
  chips> set_state_defaults("chips")
  chips> chips_line(0,0,2,1)
  0
	

Here we mix ChIPS and S-Lang commands. The CLEAR command is used to remove any previous plots and set the axis limits to 0 and 1. Then we use S-Lang commands to reset the values in the ChIPS state object and then to draw a line between (0,0) and (2,1).

Example 2

  chips> clear
  chips> chips_line(0.1,0.1,0.9,0.1,_chips->red,1,_chips->dotdash)
  0
	

This draws a horizontal red line, using the DOTDASH style and with a width of 1, between (0.1,0.1) and (0.9,0.1).

Example 3

  chips_clear();
  chips.linecolor = _chips->red;
  chips.linewidth = 1;
  chips.linestyle = _chips->dotdash;
  () = chips_line(0.1,0.1,0.9,0.1);
	

This part of a S-lang script has the same result as the previous example. This time the ChIPS state object is used to set the line parameters, rather than supplying them as optional parameters to the "chips_line()" function. Note that any following lines will also be drawn in red using the DOTDASH style until the ChIPS state object is changed, or the attributes are explicitly specified in the chips_line() call.

Bugs

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

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



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.