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/overplot.py.html
Hardcopy (PDF): A4 | Letter

Gallery: Overplotting curves (Python)

Examples


Two curves in the same plot

[ChIPS output]
Postscript version
crv = ChipsCurve()
crv.line.style = "noline"
crv.symbol.style = "square"
crv.symbol.size = 3.0
crv.symbol.fill = 0
add_curve("spectrum.fits[data][cols x,y]",crv)
crv = ChipsCurve()
crv.symbol.style = "none"
crv.line.color = "red"
crv.line.thickness = 2
add_curve("spectrum.fits[fit][cols x,y]",crv)
log_scale(XY_AXIS)

set_plot_xlabel("Energy (keV)")
set_plot_ylabel("Count s^{-1} keV^{-1}")
set_plot_title("Source spectrum")

set_xaxis(["offset.perpendicular",35])
set_plot(["leftmargin",0.25])
set_yaxis(["offset.perpendicular",45])

add_line(0.6,3.0e-4,0.9,3.0e-4,["color","red","thickness",2])
add_label(1.0,3.0e-4,"Model",["color","red","valign",0.5])

Two curves in the same plot, one with error bars

[ChIPS output]
Postscript version
add_window(6.0,3.0)
crv = ChipsCurve()
crv.line.style = "noline"
crv.symbol.style = "square"
crv.symbol.size = 3.0
crv.symbol.fill = 0
add_curve("spectrum.fits[data][cols x,y,dylo,dyhi]",crv)
crv = ChipsCurve()
crv.symbol.style = "none"
crv.line.color = "red"
crv.line.thickness = 2
add_curve("spectrum.fits[fit][cols x,y]",crv)
log_scale(XY_AXIS)
limits(X_AXIS,0.5,10.0)

set_plot_xlabel("Energy (keV)")
set_plot_ylabel("Count s^{-1} keV^{-1}")

set_xaxis(["offset.perpendicular",35])
set_plot(["leftmargin",0.15])
set_yaxis(["offset.perpendicular",45])
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.