About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2008

URL: http://cxc.harvard.edu/chips4.1/get_axis.py.html
AHELP for ChIPS 4.1

get_axis

Context: py.chips

Synopsis

Retrieves the attribute value(s) of the axis.

Syntax

get_axis()
get_axis(id [,attribute])

Description

  • id - an optional ChipsId structure containing values to modify the currency state for the command or a string id to specify an axis within the current plot.
  • attribute - a string containing the name of the attribute to retrieve

The get_axis command returns a structure containing all the attribute values of the axis. 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.

The attributes associated with axes are:

Attribute Description
automin Should the axis automatically reset its minimum when a curve/contour/histogram is added?
automax Should the axis automatically reset its maximum when a curve/contour/histogram is added?
color Color of the axis base line segment
depth Integer value indicating axis depth
label.angle Angle of the axis label
label.color Color of the axis label
label.font Font for the axis label text
label.fontstyle Style of the axis label text
label.halign Horizontal location of the axis label
label.size Font size of the axis label
label.valign Vertical location of the axis label
label.visible Is the label visible or hidden?
majortick.color The color to use for major ticks
majortick.count Default number of ticks to display when major mode is count
majortick.interval Spacing to use between ticks when major mode is interval
majortick.length Length of major ticks
majortick.mode Mode of the axis tickmark positioning
majortick.style Style of the axis tickmarks
majortick.thickness Thickness of major ticks
majortick.visible Are major ticks visible or hidden?
majorgrid.color Color of the axis major grids
majorgrid.style Stipple pattern used to draw the axis major grids
majorgrid.thickness Thickness of the axis major grids
majorgrid.visible Should major grids be visible?
minortick.color The color to use for minor ticks
minortick.count Default number of ticks to display when minor mode is count
minortick.interval Spacing to use between ticks when minor mode is interval
minortick.length Length of minor ticks
minortick.mode Mode of the axis tickmark positioning
minortick.style Style of the axis tickmarks
minortick.thickness Thickness of minor ticks
minortick.visible Are minor ticks visible or hidden?
minorgrid.color Color of the axis minor grids
minorgrid.style Stipple pattern used to draw the axis minor grids
minorgrid.thickness Thickness of the axis minor grids
minorgrid.visible Should minor grids be visible?
offset.parallel Axis label offset from axis start (-.5) to axis end (.5)
offset.perpendicular Axis label offset from axis baseline in pixels
pad The percentage of padding to add to an axis in arbitrary|limits|interval modes
thickness Thickness of the axis
tickformat Print format for axis ticklabels
ticklabel.angle Angle of the axis ticklabel
ticklabel.color Color of the axis ticklabels
ticklabel.font Font for the axis ticklabel text
ticklabel.fontstyle Style of the axis ticklabel text
ticklabel.halign Horizontal location of the axis ticklabel
ticklabel.offset Offset of ticklabels to axis base (in pixels)
ticklabel.size Font size of the axis ticklabel
ticklabel.style Style of the axis ticklabels
ticklabel.valign Vertical location of the axis ticklabel
ticklabel.visible Is the ticklabel visible or hidden?
x.label The value of the x-axis label
y.label The value of the y-axis label

Note that the axis label text is not included in the attributes. In order to get that value, use the get_axis_text command.

To see if an axis is hidden or visible, use the get_axis_visible command.

Axis Range

The get_axis_range command returns the range of the specified axis of the current plot. The values are returned as [min, max].

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_axis_automax
get_axis_automin
get_axis_color
get_axis_depth
get_axis_label_angle
get_axis_label_color
get_axis_label_font
get_axis_label_fontstyle
get_axis_label_halign
get_axis_label_size
get_axis_label_valign
get_axis_label_visible
get_axis_major_color
get_axis_major_interval
get_axis_major_length
get_axis_major_mode
get_axis_major_num
get_axis_major_style
get_axis_major_thickness
get_axis_majorgrid_color
get_axis_majorgrid_style
get_axis_majorgrid_thickness
get_axis_majorgrid_visible
get_axis_minor_color
get_axis_minor_interval
get_axis_minor_length
get_axis_minor_mode
get_axis_minor_num
get_axis_minor_style
get_axis_minor_thickness
get_axis_minorgrid_color
get_axis_minorgrid_style
get_axis_minorgrid_thickness
get_axis_minorgrid_visible
get_axis_pad
get_axis_parallel_offset
get_axis_perpendicular_offset
get_axis_scale
get_axis_thickness
get_axis_tickformat
get_axis_ticklabel_angle
get_axis_ticklabel_color
get_axis_ticklabel_font
get_axis_ticklabel_fontstyle
get_axis_ticklabel_halign
get_axis_ticklabel_offset
get_axis_ticklabel_size
get_axis_ticklabel_style
get_axis_ticklabel_valign
get_axis_ticklabel_visible
get_axis_tickstyle
get_axis_transform
get_major_ticks_visible 
get_minor_ticks_visible

Example 1

chips> add_axis(X_AXIS, 20, 0, 100, "color=yellow")
chips> print(get_axis())
chips> print(get_axis("ax1","color"))

An axis is created and becomes current. Calling get_axis with no argument returns all the attributes of the object. get_axis is called a second time to return just the "color" attribute.

Example 2

chips> add_axis(X_AXIS, 20, 0, 100, "color=yellow")
chips> add_axis(XY_AXIS, 40, 0, 100,"color=magenta")
chips> print(get_axis("ax1"))

Two axes are created. get_axis is called with the id of the first x-axis, returning all attributes.

Example 3

chips> id=ChipsId()
chips> id.axis="ax1"
chips> print(get_axis(id))

A ChipsId structure is created and the id.axis field is set to "ax1". get_axis is called with the ChipsId.

Example 4

chips> axisatt = get_axis()
chips> print(axisatt)

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

Bugs

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

Last modified: December 2008



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