|
|
|
|
Gallery: Histograms (Python)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
tbl = read_file("spectrum.fits[fit]")
xlo = get_colvals(tbl,"xlo")
xhi = get_colvals(tbl,"xhi")
y = get_colvals(tbl,"y")
add_histogram(xlo,xhi,y,["line.color","red"])
log_scale(X_AXIS)
A histogram which shows the bin edges
tbl = read_file("histogram.fits")
xlo = get_colvals(tbl,"xlo")
xhi = get_colvals(tbl,"xhi")
y = get_colvals(tbl,"y")
add_histogram(xlo,xhi,y,["line.style","longdash","dropline",1])
A histogram showing the full range of options
tbl = read_file("histogram.fits")
xlo = get_colvals(tbl,"xlo")
xhi = get_colvals(tbl,"xhi")
y = get_colvals(tbl,"y")
dylo = get_colvals(tbl,"dylo")
dyhi = get_colvals(tbl,"dyhi")
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. |