Synopsis
Creates a horizontal line.
Syntax
add_hline([id,] y [,attributes]) Horizontal lines can also be created directly from the GUI using the "Annotate" menu item.
Description
The function arguments.
Argument | Description |
---|---|
id | A ChipsId structure identifying the item. |
y | The location along the vertical axis through which the horizontal line should pass; the current coordinate system is used if the "coordsys" attribute is not set. |
attributes | Configure object properties by giving an attribute string (a space-separated list of key=value pairs), list, dictionary, or a ChIPS object. |
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 by using the 'coordsys' attribute. 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.
Examples
Example 1
chips> add_hline(0.1)
Add a horizontal line at y=0.1 in the current coordinate system.
Example 2
chips> add_hline(0.1, ['coordsys', PLOT_NORM])
Add the line at one-tenth of the height of the plot.
Example 3
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 |
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