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/limits.py.html
AHELP for ChIPS 4.0 limits Context: py.chips

Synopsis

Changes the limits of one or more axes in a plot.

Syntax

limits([ChipsId,] dimension, min, max)
limits([ChipsId,] dimension, object, ChipsId)
limits([ChipsId,] object, id)

Description

  • ChipsId - an optional ChipsId structure containing values to modify the currency state for the command.
  • dimension - operate on axis in X dimension (X_AXIS), Y dimension (Y_AXIS), or both (XY_AXIS).
  • min - the minimum value for the axis range; "AUTO" tells ChIPS to determine the minimum
  • max - the maximum value for the axis range; "AUTO" tells ChIPS to determine the maximum
  • object - if snapping to an object, which object should be used (e.g. chips_curve, chips_contour, chips_histogram).
  • id - the string id of the object to use for the snap.

The limits command sets the axes ranges for the x and/or y dimensions of a plot. There are three ways to specify the limit values:

  • user inputs the minimum and/or maximum values
  • the keyword "AUTO" or string "auto" is used for the min and/or max, telling ChIPS to calculate that value based on the data
  • set the limits to match a particular curve, contour, or histogram that exists in the figure

If the minimum value is greater than the maximum value, ChIPS automatically transposes them.

When the limits of an axis are changed, any axes that are bound to that axis are also changed, including plot border axes; see "ahelp py.chips bind_axes" for more information. The automin and automax properties of the modified axis are disabled as well when it is altered by a limits command. Reenable the automin and automax properties of the axis so that it will automatically rescale when new objects are added; see "ahelp py.chips set_axis" for more information.

Example 1

chips> limits(XY_AXIS, AUTO, 100)

The command automatically calculates the minimum limit of the current x and y axes from the data. The maximum value of both axes is set to 100.

Example 2

chips> add_curve([40,50,60],[50,40,60],'line.color=red')
chips> add_curve([50,60,70],[50,60,70],'line.color=gold')
chips> limits(chips_curve,'crv1')
chips> limits(Y_AXIS,chips_curve,'crv2')

Snap the limits of both axes to the range of curve 'crv1' and then snap the y axis range to the range of curve 'crv2'

Example 3

chips> limits(X_AXIS, 4,10)
chips> set_axis(["automin",True,"automax",True])
chips> add_curve([-23,4,15],[10,8,11])

Set the X-axis limits of the current plot to run from 4 to 10. Then reenable the automin and automax properties of the axis. When the curve is added, the axis limits automatically adjust.

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.