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

Skip the navigation links
Last modified: 10 December 2007

URL: http://cxc.harvard.edu/chips4.0/gallery/curves.py.html
Hardcopy (PDF): A4 | Letter

Gallery: Basic curves (Python)

Examples


A curve marked with symbols and connected by a red line

[ChIPS output]
Postscript version
crv = ChipsCurve()
crv.symbol.size = 3.0
crv.line.color = "red"
add_curve("spectrum.fits[cols x,y]",crv)

A curve marked with diamonds

[ChIPS output]
Postscript version
crv = ChipsCurve()
crv.line.style = "noline"
crv.symbol.style = "diamond"
crv.symbol.size = 3.0
add_curve("spectrum.fits[cols x,y]",crv)
log_scale(Y_AXIS)

A curve connected by a dotted line

[ChIPS output]
Postscript version
crv = ChipsCurve()
crv.line.style = "dot"
crv.symbol.style = "none"
add_curve("spectrum.fits[cols x,y]",crv)
log_scale(X_AXIS)

A curve showing the full range of options

[ChIPS output]
Postscript version
# Create x, y, and error arrays
x = numpy.arange(1.0,10.0,2.0)
y = x**2
dx = x*0 + 1
dylo = y*0.15
dyhi = y*0.1
add_curve(x,y,[dylo,dyhi,dx,dx])

# Change the curve properties
crv = ChipsCurve()
crv.line.color = "red"
crv.line.style = "longdash"
crv.symbol.color = "green"
crv.symbol.style = "circle"
crv.err.style = "capped"
crv.err.color = "blue"
set_curve(crv)

log_scale(Y_AXIS)
set_plot_title("y=x^2")
Hardcopy (PDF): A4 | Letter
Last modified: 10 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.