Last modified: December 2013

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

shuffle_region

Context: regions

Synopsis

Shuffles the rendering order of the region within the depth.

Syntax

shuffle_region()
shuffle_region(direction)
shuffle_region(id)
shuffle_region(id, direction)

Description

The function arguments.

Argument Description
direction What direction should the object be shuffled? The options are: chips_forward, chips_backward, chips_front, and chips_back. The default value is chips_forward.
id A ChipsId structure identifying the item, or a string containing the name of the object.

The shuffle_region command modifies the location of the specified region within the stack of items at the same depth. It may be used to position a region in front of or behind other objects which are at the same depth.


Examples

Example 1

chips> rp = ChipsRegion()
chips> rp.fill.style = 'solid'
chips> rp.fill.color = "cyan"
chips> rp.opacity = 0.6
chips> add_region([0.2,0.5,0.5,0.1], [0.2,0.4,0.9,0.7], rp)
chips> rp.fill.color = "lime"
chips> add_region(5, 0.5, 0.6, 0.4, rp)
chips> rp.fill.color = "forest"
chips> add_region(3, 0.6, 0.4, 0.5, rp)
chips> shuffle_region("reg1", chips_front)

Create three overlapping regions at the default depth, then move "reg1" (the first region) to the front of the display.

Example 2

chips> shuffle_region(chips_back)

Move the current region to the back of the depth.


Shuffling objects

By default, objects within a depth are ordered chonologically based on when they were added to that depth. The objects are stacked with the oldest item at the back of the list and the newest item at the front of the list. This order dictates how the objects overlap when drawn.

The shuffle command changes the object's position within the stack. Any given object may be shuffled forward or backward one place in the stack or sent directly to the front or back of the stack.

The direction options:

Value Description
chips_back Send to the back of the stack.
chips_front Send to the front of the stack.
chips_forward Move one step closer to the front of the stack.
chips_backward Move one step further back along the stack.

The shuffle routines can only operate on a single object. An error is returned if currency is set to "all".


Bugs

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

See Also

axes
shuffle_axis
concepts
depthcontrol
contours
shuffle_contour
contrib
chips_regions
curves
shuffle_curve
depth
collapse_depths, display_depth, get_default_depth, hide_depth, reindex_depth, set_default_depth
histograms
shuffle_histogram
images
shuffle_colorbar, shuffle_image
labels
shuffle_label
lines
shuffle_line
points
shuffle_point
regions
add_region, current_region, delete_region, display_region, get_region, hide_region, move_region, set_region
shuffle
shuffle, shuffle_back, shuffle_backward, shuffle_forward, shuffle_front
utilities
load_fill