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/add_axis.py.html
AHELP for ChIPS 4.1

add_axis

Context: py.chips

Synopsis

Creates an axis.

Syntax

add_axis( [ChipsId,] dimension, position, min, max, [,attributes])

Description

  • ChipsId - an optional ChipsId structure containing values to modify the currency state for the command.
  • dimension - add axis in X dimension, Y dimension, or both
  • position - the location of the axis in the appropriate dimension (in X for Y axes and in Y for X axes); the current coordinate system is used if one is not specified.
  • min, max - the minimum and maximum values to use for the initial range of the axis.
  • attributes - optional parameters which allow the user to configure properties though a structure, list, or attribute string.

The add_axis command creates an axis for the requested dimension with attributes specified by user preferences or in an attribute list. Since the length of the axis spans the plot area, a single position element is needed to specify the location of the axis. The axis position may be specified in plot normalized or data coordinates. The new axis (or axes if dimension is XY_AXIS) becomes current by default; providing a ChipsId overrides the currency state.

A coordinate system is defined by an X axis and a Y axis within a given plot. If a plot does not exist when an axis is added, it is automatically created. If X and Y axes are added in a single call, that axis pair defines a new coordinate system. If an X axis is added to a plot which contains a pair of Y axes, two new coordinate systems are defined.

Customizing the Axis

There are several attributes that control the axis characteristics. The attributes can be set to the ChIPS defaults, values provided in the add_axis command, or values from the user's preference file.

The attributes may also be modified with the set_axis command at any time; see "ahelp set_axis" and "ahelp setget" for more information.

The attributes associated with axes are:

Attribute Description Options Default
automin Should the axis automatically reset its minimum when a curve/contour/histogram is added false|true; see the Booleans section of "ahelp chipsopt" true
automax Should the axis automatically reset its maximum when a curve/contour/histogram is added false|true; see the Booleans section of "ahelp chipsopt" true
color Color of the axis base line segment name or hex; see the Color section of "ahelp chipsopt" default: white in the ChIPS window, black on printout
coordsys coordinate system for the axis PIXEL, WINDOW_NORM, FRAME_NORM, PLOT_NORM, DATA see "ahelp coordsys"
depth Integer value indicating axis depth see the Depth section of "ahelp chipsopt" 100
label.angle Angle of the axis label -360:360 0
label.color Color of the axis label name or hex; see the Color section of "ahelp chipsopt" default: white in the ChIPS window, black on printout
label.font font for the axis label text helvetica|courier|times|greek; see the Font section of "ahelp chipsopt" helvetica
label.fontstyle style of the axis label text normal|bold|italic|bolditalic; see the Font Style section of "ahelp chipsopt" normal
label.halign Horizontal location of the string reference point of the axis label auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" center
label.size Font size of the axis label 1:100 14
label.valign Vertical location of the string reference point of the axis label auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" center
majorgrid.color Color of the axis major grids name or hex; see the Color section of "ahelp chipsopt" default: white in the ChIPS window, black on printout
majorgrid.style stipple pattern used to draw the axis major grids see the Axis Style section of "ahelp chipsopt" shortdash
majorgrid.thickness Thickness of the axis major grids 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1
majorgrid.visible Should major grids be visible false|true; see the Booleans section of "ahelp chipsopt" false
majortick.color The color to use for major ticks name or hex; see the Color section of "ahelp chipsopt" default: white in the ChIPS window, black on printout
majortick.count Default number of ticks to display when major mode is count arbitrary|count|interval|limits|nice; see the Tick Mode section of "ahelp chipsopt" 4
majortick.interval Spacing to use between ticks when major mode is interval arbitrary|count|interval|limits|nice; see the Tick Mode section of "ahelp chipsopt" 10
majortick.length length of major ticks non-negative integer 1
majortick.mode Mode of the axis tickmark positioning arbitrary|count|interval|limits|nice; see the Tick Mode section of "ahelp chipsopt" limits
majortick.style Style of the axis tickmarks inside|outside|centered; see the Tick Style section of "ahelp chipsopt" inside
majortick.thickness Thickness of major ticks 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1
majortick.visible Are major ticks visible or hidden false|true; see the Booleans section of "ahelp chipsopt" true
minorgrid.color Color of the axis minor grids name or hex; see the Color section of "ahelp chipsopt" default: white in the ChIPS window, black on printout
minorgrid.style stipple pattern used to draw the axis minor grids see the Axis Style section of "ahelp chipsopt" dot
minorgrid.thickness Thickness of the axis minor grids 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1
minorgrid.visible Should minor grids be visible false|true; see the Booleans section of "ahelp chipsopt" false
minortick.color The color to use for minor ticks name or hex; see the Color section of "ahelp chipsopt" default: white in the ChIPS window, black on printout
minortick.count Default number of ticks to display when minor mode is count arbitrary|count|interval|limits|nice; see the Tick Mode section of "ahelp chipsopt" 4
minortick.interval Spacing to use between ticks when minor mode is interval arbitrary|count|interval|limits|nice; see the Tick Mode section of "ahelp chipsopt" 10
minortick.length length of minor ticks non-negative integer 1
minortick.mode Mode of the axis tickmark positioning arbitrary|count|interval|limits|nice; see the Tick Mode section of "ahelp chipsopt" limits
minortick.style Style of the axis tickmarks inside|outside|centered; see the Tick Style section of "ahelp chipsopt" inside
minortick.thickness Thickness of minor ticks 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1
minortick.visible Are minor ticks visible or hidden false|true; see the Booleans section of "ahelp chipsopt" true
offset.parallel axis label offset from axis start (-.5) to axis end (.5) -0.5:0.5 0
offset.perpendicular axis label offset from axis baseline in pixels -100:100 40
pad The percentage of padding to add to an axis in arbitrary limits or interval modes non-negative decimal 0.05
thickness Thickness of the axis 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1
tickformat print format for axis ticklabels alphanumeric; see the Tick Format section of "ahelp chipsopt" %g
ticklabel.angle angle of the axis ticklabel -360:360 0
ticklabel.color Color of the axis ticklabels name or hex; see the Color section of "ahelp chipsopt" default
ticklabel.font font for the axis ticklabel text helvetica|courier|times|greek; see the Font section of "ahelp chipsopt" helvetica
ticklabel.fontstyle style of the axis ticklabel text normal|bold|italic|bolditalic; see the Font Style section of "ahelp chipsopt" normal
ticklabel.halign Horizontal location of the string reference point of the axis ticklabel auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" center
ticklabel.offset Offset of ticklabels to axis base (in pixels) non-negative value 6
ticklabel.size Font size of the axis ticklabel 1:100 12
ticklabel.style Style of the axis ticklabels inside, outside outside
ticklabel.valign Vertical location of the string reference point of the axis ticklabel auto|base|center|left|right|top; see the Text Alignment section of "ahelp chipsopt" center
x.stem stem used for x axis id alphanumeric ax
y.stem stem used for y axis id alphanumeric ay

Example 1

chips> id=ChipsId()
chips> id.coord_sys=PLOT_NORM
chips> add_axis(id,XY_AXIS,0,1,100)

Add an X axis at the bottom and a Y axis at the left edge of the plot. Set the default limits to run from 1 to 100.

Example 2

chips> settings = ChipsAxis()
chips> settings.color = 'blue'
chips> settings.thickness = 0.5
chips> settings.mode = 'interval'
chips> add_axis(X_AXIS,0,0,100,settings)

Populate the "settings" structure with the attribute values, then add an X axis with limits from 0 to 1000.

Example 3

chips> add_plot()
chips> add_axis(XY_AXIS,.5,1,10,['ticklabel.angle', '45',
'majorgrid.visible', 'true'])

Create crosshair axes in a plot with major grids visible, specifying the attribute values in a list.

CHANGES IN CIAO 4.1

coordsys keyword added to attributes

The attribute "coordsys" sets the coordinate system when the object is created. ChipsIds still can be used to set coordinate systems. If a ChipsId and coordsys attribute are both provided, the coordsys value takes precedence.

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.