Last modified: December 2013

URL: https://cxc.cfa.harvard.edu/chips/ahelp/add_point.html
AHELP for CIAO 4.11 ChIPS v1

add_point

Context: points

Synopsis

Creates a point.

Syntax

add_point([id,] xpos, ypos, [,attributes])

Points 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.
xpos, ypos The location of the label; the current coordinate system is used if the "coordsys" attribute is not set. The halign and valign attributes control the location of the label relative to the label text.
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_point command creates a point whose attributes are specified by user preferences or in an attribute list. The new point becomes current by default; providing a ChipsId overrides the currency state.

The user specifies the location of the point as a coordinate pair (xpos and ypos). This position can be specified in data, pixel, frame, or plot normalized coordinates using the 'coordsys' attribute. Points specified in data coordinates will only be displayed if the are within the coordinate system range.

Customizing the Point

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

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

Please see the section "Point Preferences and Attributes" below the examples for a list of the point preferences.


Examples

Example 1

chips> add_point(4.4, -2.3e4)

Add a point at position (4.4, -2.3e4) in the current coordinate system.

Example 2

chips> add_point(0.1, 0.9, ['coordsys', PLOT_NORM, 'style', 'square'])

Adds a square to the top-left corner of the plot.

Example 3

chips> add_point(5, 10, {"color": "blue", "style": "uptriangle",
"size": 12})

Add an upward-pointing triangle point, specifying the attribute values in a dictionary.

Example 4

chips> pnt = ChipsPoint()
chips> pnt.color = "blue"
chips> pnt.size = 18
chips> pnt.stem = "MyPoint"
chips> add_point(100, 100, pnt)

Populating the "pnt" structure with the attribute values, then adding the point.


Point Preferences and Attributes

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

Attribute Description Options Default Set?
angle Angle, in degrees, at which the point is drawn -360.0 to 360.0 0.0 Yes
color color of the point name or hex; see the Color section of "ahelp chipsopt" default Yes
coordsys coordinate system for the point PIXEL, WINDOW_NORM, FRAME_NORM, PLOT_NORM, DATA see "ahelp coordsys" Yes
depth Integer value indicating point depth see the Depth section of "ahelp chipsopt" default Yes
fill fill the point? see the Booleans section of "ahelp chipsopt" true Yes
size size of the point 1 to 100 12 Yes
stem stem used for point id An alpha-numeric character sequence that does not contain a space pnt No
style symbol style see the Symbol Styles section of "ahelp chipsopt" cross 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
points
current_point, delete_point, display_point, get_point, hide_point, move_point, set_point, shuffle_point