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

URL: http://cxc.harvard.edu/chips/ahelp/move_colorbar.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.6 ChIPS v1

move_colorbar

Context: images

Synopsis

Moves the colorbar to a new location.

Syntax

move_colorbar(xval, yval)
move_colorbar(xval, yval, mode)
move_colorbar(id, xval, yval)
move_colorbar(id, xval, yval, mode)

Description

The function arguments.

Argument Description
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_colorbar command moves the colorbar to a new position. The new location may be specified as an absolute position (default) or as relative offsets from the original location. When the "mode" parameter is set to absolute (0), (xval,yval) will be the origin of the repositioned colorbar.

The following coordinate systems may be used to move a colorbar: PIXEL, WINDOW_NORM, FRAME_NORM, PLOT_NORM, or DATA. The system is specified by setting the coord_sys field of the optional ChipsId structure which may be passed into the move_colorbar routine. If a ChipsId is not provided, the default coordinate system of the colorbar is used.

When a colorbar 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 that the colorbar is in before applying them to the colorbar. This means that colorbars that are originally placed in normalized coordinates and get relocated using data coordinates will not be clipped if they land outside the visible data range. Conversely, colorbars in data coordinates which are moved using normalized coordinates to beyond the plot area will be clipped.

This command is equivalent to calling the move command with 'chips_colorbar' specified as the object.

Example 1

chips> move_colorbar(0.5, 0.05)

Move the current color bar to (0.5, 0.05) in the coordinate system used to create it.

Example 2

chips> id = ChipsId()
chips> id.coord_sys = PIXEL
chips> move_colorbar(id, -20, 0, 1)

For a colorbar specified in data coordinates, adjust the position by 20 pixels to the left in the x direction. Do not move it in the y direction.

Example 3

chips> id = ChipsId()
chips> id.colorbar = 'all'
chips> id.coord_sys = DATA
chips> move_colorbar(id, 40, 10, 1)

Shift all colorbars by the same distance in data coordinates.

Bugs

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

See Also

images
add_colorbar, current_colorbar, delete_colorbar, display_colorbar, get_colorbar, hide_colorbar, set_colorbar, shuffle_colorbar

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

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