Last modified: December 2013

URL: https://cxc.cfa.harvard.edu/chips/ahelp/move.html
Jump to: Description · Examples · Bugs


AHELP for CIAO 4.11 ChIPS v1

move

Context: utilities

Synopsis

Moves the specified object to a new location.

Syntax

move(object, xval, yval)
move(object, xval, yval, mode)
move(id, object, xval, yval)
move(id, object, xval, yval, mode)

Description

The function arguments.

Argument Description
object What type of object to move, such as chips_label or chips_plot. See the Object Type section of "ahelp chipsopt".
xval, yval The x and y coordinates to move. The mode parameter determines whether these are relative or absolute. Unless explicitly specified by the coord_sys field of the optional ChipsId argument, the coordinate system used to create the object is used.
mode The position is in absolute coordinates (mode=0) or relative (mode=1). The default is absolute.
id A ChipsId structure identifying the item.

The move command moves the specified object to a new position. The new location may be specified as an absolute position (default) or as relative offsets from the original location.

The coordinate system for the move is specified by setting the coord_sys field of the optional ChipsId structure which may be passed into the move routine. If a ChipsId is not provided, the default coordinate system of the object is used.

The following coordinate systems may be used for movable objects:

Object Pixel Window_Norm Frame_Norm Plot_Norm Data
axis no no yes yes yes
frame yes yes no no no
label yes yes yes yes yes
line yes yes yes yes yes
plot yes yes yes no no
point yes yes yes yes yes
region yes yes yes yes yes

When an object is moved, it remains in its original coordinate system regardless of what coordinate system was used for the move. The move command translates the specified values to the coordinate system associated with the object before applying them. This means that objects that are originally placed in normalized coordinates (such as labels, lines, points, and regions) and get relocated using data coordinates will not be clipped if they land outside the visible data range. Conversely, objects in data coordinates which are moved using normalized coordinates to beyond the plot area will be clipped.

There is also a "move" command for specific ChIPS objects: move_axis, move_colorbar, move_frame, move_image, move_label, move_line, move_plot, move_point, and move_region.


Examples

Example 1

chips> move(chips_label, 0.5, 0.5)

Move the current label to (0.5,0.5) in the coordinate system used to create it.

Example 2

chips> clear()
chips> add_curve([1,2,3], [4,5,6])
chips> add_label(0.1, 0.95, 'ACIS', ['coordsys', PLOT_NORM])
chips> id = ChipsId()
chips> id.coord_sys = DATA
chips> move(id, chips_label, 0, -0.1, 1)

A label is added to the top-left of the plot, using plot-normalized coordinates. It is then adjusted in the Y direction using relative data coordinate, so it is moved down by 0.1 in Y.


Bugs

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