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 2007

URL: http://cxc.harvard.edu/chips4.0/add_axis.py.html
AHELP for ChIPS 4.0 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 py.chips set_axis" and "ahelp py.chips 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 py.chips 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 py.chips chipsopt" true
color Color of the axis base line segment see the Color section of "ahelp py.chips chipsopt" default: white in the ChIPS window, black on printout
depth Integer value indicating axis depth see the Depth section of "ahelp py.chips chipsopt" 100
label.angle Angle of the axis label -360:360 0
label.color Color of the axis label see the Color section of "ahelp py.chips chipsopt" default: white in the ChIPS window, black on printout
label.font font for the axis label text see the Font section of "ahelp py.chips chipsopt" helvetica
label.fontstyle style of the axis label text see the Font Style section of "ahelp py.chips chipsopt" normal
label.halign Horizontal location of the string reference point of the axis label see the Text Alignment section of "ahelp py.chips 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 see the Text Alignment section of "ahelp py.chips chipsopt" center
majorgrid.color Color of the axis major grids see the Color section of "ahelp py.chips 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 py.chips chipsopt" shortdash
majorgrid.thickness Thickness of the axis major grids see the Thickness section of "ahelp py.chips chipsopt" 1
majorgrid.visible Should major grids be visible false|true; see the Booleans section of "ahelp py.chips chipsopt" false
majortick.color The color to use for major ticks see the Color section of "ahelp py.chips chipsopt" default: white in the ChIPS window, black on printout
majortick.count Default number of ticks to display when major mode is count see the Tick Mode section of "ahelp py.chips chipsopt" 4
majortick.interval Spacing to use between ticks when major mode is interval see the Tick Mode section of "ahelp py.chips chipsopt" 10
majortick.length length of major ticks non-negative integer 1
majortick.mode Mode of the axis tickmark positioning see the Tick Mode section of "ahelp py.chips chipsopt" limits
majortick.style Style of the axis tickmarks see the Tick Style section of "ahelp py.chips chipsopt" inside
majortick.thickness Thickness of major ticks see the Thickness section of "ahelp py.chips chipsopt" 1
majortick.visible Are major ticks visible or hidden false|true; see the Booleans section of "ahelp py.chips chipsopt" true
minorgrid.color Color of the axis minor grids see the Color section of "ahelp py.chips 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 py.chips chipsopt" dot
minorgrid.thickness Thickness of the axis minor grids see the Thickness section of "ahelp py.chips chipsopt" 1
minorgrid.visible Should minor grids be visible false|true; see the Booleans section of "ahelp py.chips chipsopt" false
minortick.color The color to use for minor ticks see the Color section of "ahelp py.chips chipsopt" default: white in the ChIPS window, black on printout
minortick.count Default number of ticks to display when minor mode is count see the Tick Mode section of "ahelp py.chips chipsopt" 4
minortick.interval Spacing to use between ticks when minor mode is interval see the Tick Mode section of "ahelp py.chips chipsopt" 10
minortick.length length of minor ticks non-negative integer 1
minortick.mode Mode of the axis tickmark positioning see the Tick Mode section of "ahelp py.chips chipsopt" limits
minortick.style Style of the axis tickmarks see the Tick Style section of "ahelp py.chips chipsopt" inside
minortick.thickness Thickness of minor ticks see the Thickness section of "ahelp py.chips chipsopt" 1
minortick.visible Are minor ticks visible or hidden false|true; see the Booleans section of "ahelp py.chips 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 see the Thickness section of "ahelp py.chips chipsopt" 1
tickformat print format for axis ticklabels alphanumeric; see the Tick Format section of "ahelp py.chips chipsopt" %g
ticklabel.angle angle of the axis ticklabel -360:360 0
ticklabel.color Color of the axis ticklabels see the Color section of "ahelp py.chips chipsopt" default
ticklabel.font font for the axis ticklabel text see the Font section of "ahelp py.chips chipsopt" helvetica
ticklabel.fontstyle style of the axis ticklabel text see the Font Style section of "ahelp py.chips chipsopt" normal
ticklabel.halign Horizontal location of the string reference point of the axis ticklabel see the Text Alignment section of "ahelp py.chips 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 see the Text Alignment section of "ahelp py.chips 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.

Bugs

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

Last modified: December 2007



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.