Chandra X-Ray Observatory (CXC)
Skip to the navigation links
Last modified: December 2012

URL: http://cxc.harvard.edu/chips/add_hline.html
AHELP for CIAO 4.5 ChIPS v1

add_hline

Context: lines

Synopsis

Creates a horizontal line.

Syntax

add_hline([ChipsId,] y [,attributes])

Horizontal lines can also be created directly from the GUI using the
"Annotate" menu item.

Description

  • ChipsId - an optional ChipsId structure containing values to modify the currency state for the command.
  • y - the location along the vertical axis through which the horizontal line should pass; the current coordinate system is used if one is not specified.
  • attributes - optional parameters which allow the user to configure properties though a structure, list, or attribute string.

The add_hline command creates a horizontal line at the specified y location. The location of the line can be specified in data, pixel, frame, or plot normalized coordinates. The line extends infinitely along the horizontal. It is clipped appropriately by its coordinate system (e.g. lines in data coordinates or plot normalized will be clipped at plot boundaries).

This command is the same as creating a horizontal line segment with add_line ("ahelp add_line") and setting the "extend" property so that it extends both ends of the line; see the Line Extend section of "ahelp chipsopt".

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_hline 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.

Please see the section "Line Preferences and Attributes" below the examples for a list of the line attributes.

Example 1

chips> add_hline(0.1)

Add a horizontal line at y=0.1 in the current coordinate system.

Example 2

chips> hl = ChipsLine()
chips> hl.color = 'blue'
chips> hl.thickness = 8.0
chips> hl.stem = 'MyLine'
chips> add_axis(XY_AXIS, 0, 0, 200)
chips> add_hline(100, hl)

Populate the "hl" structure with the attribute values, then add a horizontal line that passes through the point 100 on the y-axis.

Line Preferences and Attributes

The attributes associated with lines are given in the following table, where the "Set?" column refers to whether the attribute can be change using the set_line() command. To change the line preference settings prepend "line." to the attribute name.

Attribute Description Options Default Set?
color line color name or hex; see the Color section of "ahelp chipsopt" default Yes
coordsys coordinate system for the line PIXEL, WINDOW_NORM, FRAME_NORM, PLOT_NORM, DATA see "ahelp coordsys" No
depth Integer value indicating line depth see the Depth section of "ahelp chipsopt" default Yes
extend Should the line extend to infinity (segment vs ray) One of "none", "both", "start", "end", chips_extend_none, chips_extend_both, chips_extend_start, or chips_extend_end. chips_extend_none Yes
stem stem used for line id An alpha-numeric character sequence that does not contain a space line No
style stipple pattern used to draw the line segment see the Line Style section of "ahelp chipsopt" chips_solid Yes
thickness line thickness 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1 Yes

Changes in CIAO 4.5

Horizontal lines can now be added directly from the GUI, using either the "Annotate" menu item or the "Annotate" option brought up by using the Right-Mouse Button in the ChIPS window.

Bugs

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

See Also

chips
chips, chipsgui, chipsrc, show_gui
concepts
aspectratio, attributes, chipsid, chipsopt, colors, coordsys, currency, depthcontrol, entitycreation, preferences, setget
lines
add_line, add_vline, current_line, delete_line, display_line, get_line, hide_line, move_line, set_line, shuffle_line

Last modified: December 2012
CXC logo

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-2012. All rights reserved.