Synopsis
Retrieves the attribute value(s) of the region.
Syntax
get_region() get_region(id) get_region(id, attribute)
Description
The function arguments.
Argument | Description |
---|---|
id | A ChipsId structure identifying the item, or a string containing the name of the object. |
attribute | The name of the attribute to retrieve, such as 'fill.style' or 'edge.color'. |
The get_region command returns a structure containing all the attribute values of the region. To retrieve the value of a specific attribute, provide the attribute name and the id or ChipsId of the object.
Some values are set to "None" in the returned structure. These entries generally correspond to attributes which may only be modified at creation time, such as the object id.
Please see the section "Region Preferences and Attributes" below the examples for a list of the region attributes.
To see if a region is hidden or visible, use the get_region_visible command.
Advanced Functions
The module of advanced ChIPS functions contains other commands for retrieving attribute values (refer to "ahelp chips" for information on loading the module):
get_region_angle get_region_depth get_region_edgecolor get_region_edgestyle get_region_edgethickness get_region_fillstyle get_region_fillcolor get_region_opacity
Examples
Example 1
chips> add_region([.1,.1,.7,.9,.7], [.07,.95,.95,.65,.07], "fill.style=1 fill.color=salmon") chips> print(get_region()) chips> print(get_region("reg1", "fill.color"))
A region is created and becomes current. Calling get_region with no argument returns all the attributes of the object. get_region is called a second time to return just the "fill.color" attribute.
Example 2
chips> add_region([.1,.1,.7,.9,.7], [.07,.95,.95,.65,.07], "fill.style=1 fill.color=salmon") chips> add_region(3,.3,.3,.3, "fill.style=1 fill.color=plum") chips> print(get_region("reg1"))
Two regions are created. get_region is called with the id of the first region, returning all attributes.
Example 3
chips> id = ChipsId() chips> id.region = "reg1" chips> print(get_region(id))
A ChipsId structure is created and the id.region field is set to "reg1". get_region is called with the ChipsId.
Example 4
chips> ri = get_region() chips> print(ri)
Retrieve a structure containing the attribute values of the current region and store the results in "ri". Print the contents of "ri".
Region Preferences and Attributes
The attributes associated with regions are given in the following table, where the "Set?" column refers to whether the attribute can be changed using the set_region() command. To change the region preference settings prepend "region." to the attribute name.
Attribute | Description | Options | Default | Set? |
---|---|---|---|---|
angle | Angle, in degrees, at which the region is drawn | -360.0 to 360.0 | 0.0 | Yes |
coordsys | coordinate system for the region | PIXEL, WINDOW_NORM, FRAME_NORM, PLOT_NORM, DATA | see "ahelp coordsys" | No |
depth | Integer value indicating region depth | see the Depth section of "ahelp chipsopt" | default | Yes |
edge.color | region edge color | name or hex; see the Color section of "ahelp chipsopt" | green | Yes |
edge.style | stipple pattern used to draw the region edges | see the Line Style section of "ahelp chipsopt" | chips_solid | Yes |
edge.thickness | Thickness of the region edge | 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" | 1 | Yes |
fill.color | region fill color | name or hex; see the Color section of "ahelp chipsopt" | green | Yes |
fill.style | Fill style for the region | see the Fill Pattern section of "ahelp chipsopt" | 0 (no fill) | Yes |
opacity | Opacity of the region fill | 0.0 to 1.0, inclusive, where 0 is fully transparent and 1 is fully opaque | 0.5 | Yes |
stem | stem used for region id | An alpha-numeric character sequence that does not contain a space | reg | No |
Bugs
See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.
See Also
- concepts
- setget
- contrib
- chips_regions
- regions
- add_region, current_region, delete_region, display_region, hide_region, move_region, set_region, shuffle_region
- utilities
- load_fill, set_current