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

Gallery: Multiple plots (S-Lang)

Examples


Data, fit, and residuals

[ChIPS output]
Postscript version
set_preference("axis.offset.perpendicular","50");

add_window(6.0,3.0);
strip_chart(2);

variable 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});

variable 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");

variable resid = read_file("spectrum.fits[residuals]");
variable x = get_colvals(resid,"x");
variable y = get_colvals(resid,"y");
variable dylo = get_colvals(resid,"dylo");
variable dyhi = get_colvals(resid,"dyhi");
variable dxlo = get_colvals(resid,"dxlo");
variable 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("Residuals (\sigma)"R);

set_xaxis({"offset.perpendicular",40});

adjust_grid_yrelsize(1,2.0);

Data, residuals, and contours in one frame

[ChIPS output]
Postscript version
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]");
variable crv = ChipsCurve;
crv.line.style = "noline";
crv.symbol.style = "square";
crv.symbol.fill = 0;
crv.symbol.size = 3.0;
set_curve(crv);

variable 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("Residuals (\sigma)"R);

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

[ChIPS output]
Postscript version
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);
variable crv = ChipsCurve;
crv.line.style = "noline";
crv.symbol.style = "square";
crv.symbol.fill = 0;
crv.symbol.size = 3.0;
set_curve(crv);

variable 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("Residuals (\sigma)"R);

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});
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.