Last modified: November 2016

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

get_colorbar

Context: images

Synopsis

Retrieves the attribute value(s) of the colorbar.

Syntax

get_colorbar()
get_colorbar(id)
get_colorbar(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 'length' or 'label.color'.

The get_colorbar command returns a structure containing all the attribute values of the colorbar. 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 "Colorbar Preferences and Attributes" below the examples for a list of the colorbar attributes.

To see if a colorbar is hidden or visible, use the get_colorbar_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_colorbar_border_visible
get_colorbar_depth
get_colorbar_halign
get_colorbar_label_angle
get_colorbar_label_color
get_colorbar_label_font
get_colorbar_label_fontstyle
get_colorbar_label_halign
get_colorbar_label_location
get_colorbar_label_size
get_colorbar_label_text
get_colorbar_label_valign
get_colorbar_label_visible
get_colorbar_length
get_colorbar_orientation
get_colorbar_parallel_offset
get_colorbar_perpendicular_offset
get_colorbar_tick_color
get_colorbar_tick_length
get_colorbar_tick_location
get_colorbar_tick_mode
get_colorbar_tick_style
get_colorbar_tick_thickness
get_colorbar_tick_visible
get_colorbar_ticklabel_angle
get_colorbar_ticklabel_color
get_colorbar_ticklabel_font
get_colorbar_ticklabel_fontstyle
get_colorbar_ticklabel_halign
get_colorbar_ticklabel_offset
get_colorbar_ticklabel_size
get_colorbar_ticklabel_valign
get_colorbar_ticklabel_visible
get_colorbar_valign
get_colorbar_visible
get_colorbar_width

Examples

Example 1

chips> add_colorbar(0.5, 0.2, "width=0.1 label.font=helvetica")
chips> print(get_colorbar())

A colorbar is created and becomes current. Calling get_colorbar with no argument returns all the attributes of the object; the output is:

border.visible = True
depth = 100
halign = 0.5
id = None
label.angle = 0.0
label.color = default
label.font = helvetica
label.fontstyle = normal
label.halign = -99.0
label.location = inside
label.size = 12
label.text = None
label.valign = -99.0
label.visible = True
length = 1.0
offset.parallel = 0.0
offset.perpendicular = 5.0
orientation = 0
stem = None
tick.color = default
tick.length = 4
tick.location = outside
tick.mode = nice
tick.style = inside
tick.thickness = 1.0
tick.visible = True
ticklabel.angle = 0.0
ticklabel.color = default
ticklabel.font = helvetica
ticklabel.fontstyle = normal
ticklabel.halign = -99.0
ticklabel.offset = 6
ticklabel.size = 12
ticklabel.style = None
ticklabel.valign = -99.0
ticklabel.visible = True
valign = 0.5
width = 0.10000000149

Example 2

chips> add_colorbar(0, .5, "id=vert orientation=vertical")
chips> add_colorbar(.5, -.05)
chips> print get_colorbar("vert")

Two colorbars are created. get_colorbar is called with the id of the first colorbar, returning all attributes.

Example 3

chips> id = ChipsId()
chips> id.colorbar = "cbar1"
chips> print get_colorbar(id)

A ChipsId structure is created and the id.colorbar field is set to "cbar1". get_colorbar is called with the ChipsId.

Example 4

chips> cbaratt = get_colorbar()
chips> print cbaratt

Retrieve a structure containing the attribute values of the current colorbar and store the results in "cbaratt". Print the contents of "cbaratt".


Colorbar Preferences and Attributes

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

Attribute Description Options Default Set?
border.visible should the border of the colorbar be visible? see the Booleans section of "ahelp chipsopt" true Yes
depth the depth of the colorbar see the Depth section of "ahelp chipsopt" default Yes
halign horizontal alignment of the colorbar auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" center Yes
label.angle angle, in degrees, of the label -360.0 to 360.0 0 Yes
label.color color of the label name or hex; see the Color section of "ahelp chipsopt" default Yes
label.font font for the label helvetica|courier|times|greek; see the Font section of "ahelp chipsopt" helvetica Yes
label.fontstyle style for the label normal|bold|italic|bolditalic; see the Font Style section of "ahelp chipsopt" normal Yes
label.halign horizontal alignment of the label auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" auto Yes
label.location which side of the colorbar does the label appear on, relative to the plot center? outside|inside inside Yes
label.size size of the label 1 to 100 12 Yes
label.text text for the colorbar label Yes
label.valign vertical alignment of the label auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" auto Yes
label.visible should the label be visible? see the Booleans section of "ahelp chipsopt" true Yes
length the length of the colorbar, in plot-normalized coordinates A real number, greater than 0. 1 Yes
offset.parallel shift of the label from the center of the colorbar -0.5 to 0.5 inclusive; 0 is the center and -0.5/+0.5 refer to the edges 0 Yes
offset.perpendicular shift of the label from the edge of the colorbar (in pixels) -100 to 100, inclusive 5 Yes
orientation orientation of the colorbar "horizontal" or "vertical" horizontal Yes
stem stem to use for colorbar ids An alpha-numeric character sequence that does not contain a space cbar No
tick.color color of the tickmarks name or hex; see the Color section of "ahelp chipsopt" default Yes
tick.length length of the tickmarks Non-negative integer 4 Yes
tick.location should the ticks and labels appear on the outside or inside of the colorbar with reference to plot center? inside|outside outside Yes
tick.mode mode for calculating tickmark locations arbitrary|count|interval|limits|nice; see the Tick Mode section of "ahelp chipsopt" nice Yes
tick.style should the tickmarks extend into the colorbar, point out of the colorbar, or both (inside, outside, or centered)? inside|outside|centered; see the Tick Style section of "ahelp chipsopt" inside Yes
tick.thickness thickness of the tickmarks 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1 Yes
tick.visible should the tickmarks be visible? see the Booleans section of "ahelp chipsopt" true Yes
ticklabel.angle angle, in degrees, of the tickmark labels -360.0 to 360.0 0 Yes
ticklabel.color color for the numeric tickmark labels name or hex; see the Color section of "ahelp chipsopt" default Yes
ticklabel.font font for the tickmark labels helvetica|courier|times|greek; see the Font section of "ahelp chipsopt" helvetica Yes
ticklabel.fontstyle style for the tickmark labels normal|bold|italic|bolditalic; see the Font Style section of "ahelp chipsopt" normal Yes
ticklabel.halign horizontal alignment of the tickmark labels auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" auto Yes
ticklabel.offset separation, in pixels, of the tickmark labels from the colorbar Non-negative value 6 Yes
ticklabel.size font size of the numeric tickmark labels 1 to 100 12 Yes
ticklabel.valign vertical alignment of the tickmark labels auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" auto Yes
ticklabel.visible should the tickmark labels be visible? see the Booleans section of "ahelp chipsopt" true Yes
valign vertical alignment of the colorbar auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" center Yes
width the width of the colorbar, in plot-normalized coordinates Non-negative value 0.05 Yes

Bugs

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

See Also

concepts
setget
images
add_colorbar, current_colorbar, delete_colorbar, display_colorbar, hide_colorbar, move_colorbar, set_colorbar, shuffle_colorbar
utilities
set_current