|
|
|
|
Gallery: Histograms (S-Lang)Examples
Displaying (x,y) data points as a histogram
add_histogram("spectrum.fits[fit][cols x,y]");
Displaying (xlow,xhigh,y) data points as a histogram
variable tbl = read_file("spectrum.fits[fit]");
variable xlo = get_colvals(tbl,"xlo");
variable xhi = get_colvals(tbl,"xhi");
variable y = get_colvals(tbl,"y");
add_histogram(xlo,xhi,y,{"line.color","red"});
log_scale(X_AXIS);
A histogram which shows the bin edges
variable tbl = read_file("histogram.fits");
variable xlo = get_colvals(tbl,"xlo");
variable xhi = get_colvals(tbl,"xhi");
variable y = get_colvals(tbl,"y");
add_histogram(xlo,xhi,y,{"line.style","longdash","dropline",1});
A histogram showing the full range of options
variable tbl = read_file("histogram.fits");
variable xlo = get_colvals(tbl,"xlo");
variable xhi = get_colvals(tbl,"xhi");
variable y = get_colvals(tbl,"y");
variable dylo = get_colvals(tbl,"dylo");
variable dyhi = get_colvals(tbl,"dyhi");
variable hist = ChipsHistogram;
hist.dropline = 1;
hist.line.color = "red";
hist.symbol.style = "diamond";
hist.symbol.size = 4.0;
hist.symbol.fill = 1;
hist.symbol.color = "orange";
hist.err.color = "green";
hist.fill.visible = 1;
hist.fill.opacity = "0.2";
hist.fill.color = "blue";
add_histogram(xlo,xhi,y,dylo,dyhi,hist);
% Move the histogram behind the axes so that the tick marks are not hidden
shuffle_back(chips_histogram);
|
![]() |
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. |