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

set_axis

Context: py.chips

Synopsis

Modifies the attributes of an existing axis.

Syntax

set_axis([id,] values)

Description

  • id - an optional ChipsId structure containing values to modify the currency state for the command or a string id to modify an axis within the current plot.
  • values - a list containing attribute value pairs or a ChipsAxis object.

The set_axis command sets the specified attributes to the provided values. The modified axis becomes current. Unless an axis id is specified, the command operates on the current axes (both x axis and y axis).

An individual axis may also be modified with set_xaxis and set_yaxis commands.

Customizing the Axis

There are several attributes that control the characteristics of axes. The set_axis command may be used to modify the attribute values of an existing axis at any time during a ChIPS session. See "ahelp attributes" and "ahelp setget" for more general information.

If multiple attributes are being set simultaneously and one of them fails, the entire command will fail and the axis will not be modified.

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? see the Booleans section of "ahelp chipsopt" true
automax Should the axis automatically reset its maximum when a curve/contour/histogram is added? 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
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
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
label.visible Is the label visible or hidden? see the Booleans section of "ahelp chipsopt" true
majortick.color The color to use for major ticks name or hex; see the Color section of "ahelp chipsopt" default
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:10 1
majortick.visible Are major ticks visible or hidden? see the Booleans section of "ahelp chipsopt" true
majorgrid.color Color of the axis major grids name or hex; see the Color section of "ahelp chipsopt" default
majorgrid.style Stipple pattern used to draw the axis major grids see the Line Style section of "ahelp chipsopt" shortdash
majorgrid.thickness Thickness of the axis major grids 0.5:10 1
majorgrid.visible Should major grids be visible? 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
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:10 1
minortick.visible Are minor ticks visible or hidden? 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
minorgrid.style Stipple pattern used to draw the axis minor grids see the Line Style section of "ahelp chipsopt" dot
minorgrid.thickness Thickness of the axis minor grids 0.5:10 1
minorgrid.visible Should minor grids be visible? see the Booleans section of "ahelp chipsopt" false
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|interval modes Non-negative decimal 0.05
thickness Thickness of the axis 0.5:10 1
tickformat Print format for axis ticklabels 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|centered; see the Tick Style section of "ahelp chipsopt" 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
ticklabel.visible Is the ticklabel visible or hidden? see the Booleans section of "ahelp chipsopt" true
tickstyle Where should the tickmarks be drawn? inside|outside|centered outside

Note that the axis text is not included in the attributes. To set the axis labels, use the set_axis_text command.

Advanced Functions

The module of advanced ChIPS functions contains other commands for setting attribute values (refer to "ahelp chips" for information on loading the module):

set_axis_automax
set_axis_automin
set_axis_color
set_axis_depth
set_axis_label_angle
set_axis_label_color
set_axis_label_font
set_axis_label_fontstyle
set_axis_label_halign
set_axis_label_size
set_axis_label_valign
set_axis_label_visible
set_axis_major_color
set_axis_major_interval
set_axis_major_length
set_axis_major_mode
set_axis_major_num
set_axis_major_style
set_axis_major_thickness
set_axis_majorgrid_color
set_axis_majorgrid_style
set_axis_majorgrid_thickness
set_axis_majorgrid_visible
set_axis_minor_color
set_axis_minor_interval
set_axis_minor_length
set_axis_minor_mode
set_axis_minor_num
set_axis_minor_style
set_axis_minor_thickness
set_axis_minorgrid_color
set_axis_minorgrid_style
set_axis_minorgrid_thickness
set_axis_minorgrid_visible
set_axis_pad
set_axis_parallel_offset
set_axis_perpendicular_offset
set_axis_thickness
set_axis_tickformat
set_axis_ticklabel_angle
set_axis_ticklabel_color
set_axis_ticklabel_font
set_axis_ticklabel_fontstyle
set_axis_ticklabel_halign
set_axis_ticklabel_offset
set_axis_ticklabel_size
set_axis_ticklabel_style
set_axis_ticklabel_valign
set_axis_ticklabel_visible
set_axis_tickstyle

Example 1

chips> set_axis(["color", "lavender", "thickness", 2, "tickformat",
"%2.1z"])

Using attribute/value pairs, set the x and y axis color to lavender, the thickness to 2, and the tickformat style to use n * 10^x notation.

Example 2

chips> s = ChipsAxis()
chips> s.color = "steelblue"
chips> s.ticklabel.angle = 45
chips> s.ticklabel.halign = "right"
chips> s.majorgrid.visible = True
chips> set_axis("ax1", s)

Populate the "s" structure with the attribute values, then use it to set axis ax1 to have visible major grids, right-justified tick labels rotated at 45 degrees, and a steelblue baseline color.

Example 3

chips> class properties:
pass
chips> p = properties()
chips> p.color='sienna'
chips> p.tickformat='%2.1d kev'
chips> set_axis('ay1',p)

Create a user-defined structure with color and tickformat fields. Use the structure to modify the values of the axis 'ay1'.

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.