How do I plot a histogram from a file?
The make_figure (S-Lang or Python help) and add_histogram (S-Lang or Python help) commands can plot data from a file (in both FITS binary and ASCII formats).
-
Two columns: A set of (xmid,y) points.
# Python make_figure("file.lis[cols x,y]","histogram") add_histogram("file.lis[cols x,y]")% S-Lang make_figure("file.lis[cols x,y]","histogram"); add_histogram("file.lis[cols x,y]");This will plot up columns x and y from the file file.lis, and use x as the middle of each bin.
-
Two columns: A set of ([xlo,xhi],y) points.
# Python make_figure("file.fits[cols r,sur_bri]","histogram") add_histogram("file.fits[cols r,sur_bri]")% S-Lang make_figure("file.fits[cols r,sur_bri]","histogram"); add_histogram("file.fits[cols r,sur_bri]");If the first column selected - here r - is a vector column with two values per row, then these two values will be used as the low and high bounds of each bin. An example of this case is when dmextract has been used to create a radial profile; the R column contains the inner and outer edges of each annulus and so can be used to define the histogram bins.
