|
|
|
|
Gallery: Multiple plots (Python)Examples
Data, fit, and residuals
set_preference("axis.offset.perpendicular","50")
add_window(6.0,3.0)
strip_chart(2)
crv = ChipsCurve()
crv.line.style = "noline"
add_curve("spectrum.fits[data][cols x,y,dylo,dyhi]",crv)
set_curve(["symbol.style","square","symbol.fill",0,"symbol.size",3.0])
hist = ChipsHistogram()
hist.line.color = "red"
hist.line.thickness = 2
add_histogram("spectrum.fits[fit][cols x,y]",hist)
log_scale(Y_AXIS)
set_plot_ylabel("Count s^{-1} keV^{-1}")
current_plot("plot2")
resid = read_file("spectrum.fits[residuals]")
x = get_colvals(resid,"x")
y = get_colvals(resid,"y")
dylo = get_colvals(resid,"dylo")
dyhi = get_colvals(resid,"dyhi")
dxlo = get_colvals(resid,"dxlo")
dxhi = get_colvals(resid,"dxhi")
add_curve(x,y,[dylo,dyhi,dxlo,dxhi])
set_curve(["line.style","noline","symbol.style","none"])
add_hline(0.0)
log_scale(X_AXIS)
limits(X_AXIS,0.5,10.0)
set_plot_xlabel("Energy (keV)")
set_plot_ylabel(r"Residuals (\sigma)")
set_xaxis(["offset.perpendicular",40])
adjust_grid_yrelsize(1,2.0)
Data, residuals, and contours in one frame
set_preference("frame.border.visible","true")
set_preference("axis.offset.perpendicular","50")
add_window(6.0,3.0)
add_frame()
col_grid_objects([2,1],0.1,0.0,1)
adjust_grid_xrelsize(1,1.2)
add_curve("spectrum.fits[data][cols x,y,dylo,dyhi]")
crv = ChipsCurve()
crv.line.style = "noline"
crv.symbol.style = "square"
crv.symbol.fill = 0
crv.symbol.size = 3.0
set_curve(crv)
hist = ChipsHistogram()
hist.line.color = "red"
hist.line.thickness = 2
add_histogram("spectrum.fits[fit][cols x,y]",hist)
log_scale(Y_AXIS)
set_plot_ylabel("Count s^{-1} keV^{-1}")
set_axis_ticklabel_visible("ax1",0)
set_plot(["bottommargin",0.45])
current_plot("plot2")
add_histogram("spectrum.fits[residuals][cols x,y]")
add_hline(0.0)
set_plot(["topmargin",0.55])
set_plot_xlabel("Energy (keV)")
set_plot_ylabel(r"Residuals (\sigma)")
set_xaxis(["offset.perpendicular",35])
bind_axes("plot1","ax1","plot2","ax1")
log_scale(X_AXIS)
current_plot("plot3")
add_contour("contours.fits",[53.6454,57.5304,63.1794],["wcs","params"])
set_plot_xlabel("kT_x (keV)")
set_plot_ylabel("Abundance")
set_xaxis(["offset.perpendicular",35])
set_yaxis(["offset.perpendicular",25])
Data and residuals in one frame, contours in another
set_preference("frame.border.visible","true")
add_window(6.0,3.0)
strip_chart(2)
reposition_frame(0.0,0.0,0.55,1.0)
add_curve("spectrum.fits[data][cols x,y,dylo,dyhi]")
limits(X_AXIS,AUTO,AUTO)
crv = ChipsCurve()
crv.line.style = "noline"
crv.symbol.style = "square"
crv.symbol.fill = 0
crv.symbol.size = 3.0
set_curve(crv)
hist = ChipsHistogram()
hist.line.color = "red"
hist.line.thickness = 2
add_histogram("spectrum.fits[fit][cols x,y]",hist)
log_scale(Y_AXIS)
set_plot_ylabel("Count s^{-1} keV^{-1}")
set_axis_ticklabel_visible("ax1",0)
set_plot(["bottommargin",0.45])
adjust_grid_yrelsize(1,2.0)
current_plot("plot2")
add_histogram("spectrum.fits[residuals][cols x,y]")
add_hline(0.0)
log_scale(X_AXIS)
set_plot_xlabel("Energy (keV)")
set_plot_ylabel(r"Residuals (\sigma)")
set_plot("all",["leftmargin",0.25])
set_yaxis(["offset.perpendicular",50])
add_frame(0.55,0.0,1.0,1.0)
add_contour("contours.fits",[53.6454,57.5304,63.1794],["wcs","params"])
set_plot_xlabel("kT_x (keV)")
set_plot_ylabel("Abundance")
set_yaxis(["offset.perpendicular",25])
|
![]() |
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. |