introduction

For each X entered, the corresponding Y is added/averaged to a bin in the histogram. If all selected Y and DYs are zero Y and DY are assumed to be 1.0. When averaging any data with zero DY is ignored. The result is an evenly spaced series of X values with the corresponding distribution in Y and the standard deviation of each Y in DY/NDY. The symbol for each bin is set to the default. You may find that the resulting data is not in the correct storage locations especially if a 3-d plot is to be produced. You may change locations with the SWAP command. If the data has a non zero DX then it may be distributed over more than 1 bin. The DX error distribution is assumed to be gaussian, and the data is distributed with a cut off at 4 sigma. If NORMAL=OFF a flat distribution is assumed.

You may not BIN mesh data. If you need to rebin mesh data then it should be decomposed to a series of data sets using the PROJECT BY n command.

options

1. MESH - Bins data into a MESH 2. ERRORS - Bins data into a MESH with errors if MESH is selected. 3. X,Y - Select the axes to specify bins. 4. BINS|N - The number of bins in the histogram. 5. VALUES - You are specifying the bin values rather than the bin edge. 6. FROM - Sets the lowest bin value (low edge) 7. TO - Sets the highest bin value. 8. BY - Sets the bin width. 9. NORMAL - Selects either a normal (Gaussian) distribution or a flat (histogram) distribution. 10. NAME - Selects the name of the appended data set 11. POINTS - Specifies the range of points within a data set to use. 12. SETS - Specifies the range of data sets to use. 13. APPEND - The new data is appended to the current data as a new set rather than replacing it. 14. AVERAGE - Produces a weighted average of the data 15. LIMITED - Selects the range of data to bin. 16. LOG - Types the result of the command 17. MONITOR - Plots the result.

AVERAGE

A weighted average is produced of the data. The data is weighted by 1/DY**2 if DY is non zero. Otherwise a weight of 1 is used. The result is X,Y,DY. If the original DYs are all zero (or 1) then the final DY is 1/SQRT(points). Where points is the number of points averaged to form a bin.

APPEND

If APPEND=ON the resulting data sets are appended to the current data sets. If OFF then the current data is replaced by the new binned data.

ERRORS

If this option and MESH are selected, then the mesh will have errors on its data.

FROM...

[[X|Y] [FROM=n] [TO=n] [BY|WIDTH|STEP=n] [BINS|N=n]] Specifies the range of the histogram. If FROM,TO and NBINS are specified BY may not be specified. FROM is the lowes bin edge. TO is the highest bin edge. BY is the bin width, And N is the number of bins.

If VALUES is specified then the FROM and TO are the center of the first bin and the center of the last bin.

If these are omitted then the data is scanned and the bins are arranged according to the current scale values. (See:SET SCALE) If the data to bin is arranged as a set of matching histograms, the final data set will have the same x values as the initial. A histogram has equally spaced x values with identical DX. Data sets match if the initial X and DX values are the same.

The following are equivalent commands: TD:BIN FROM 0 TO 10 BY 1 TD:BIN FROM 0 TO 10 N=10 TD:BIN FROM 0 BY 1 N=10 TD:BIN VALUES FROM .5 TO 9.5 BY 1

LIMITED

Specifies which data are to be binned. If limits are not specified, the default is the current plot limits. See:Command SET LIMITS. 1. X - Specifies X limit 2. Y - Specifies Y limit 3. Z - Specifies the Z limit 4. CURSOR - Brings up the cursor. You move it to the X,Y value you wish then press the space bar to enter both X,Y or X to enter X or Y to enter Y. 5. RECURSOR - The cursor enters both limits.

Example TD:BIN LIMITED FROM X=1 to X=5 Sets limits on the range of X data to bin. TD:BIN LIMITED FROM 1,5.5 TO 5,50.8 Sets limits on the range of X,Y to bin. This does not set the range of the final data sets.

MESH

Bins data into a mesh of Z vs X,Y. The Z values are added or averaged together. If Z does not exist you are given an error message. APPEND is ignored for a MESH. example TD:BIN MESH X FROM 1 to 10 by 1 Y FROM 10 to 100 by 10

MONITOR

If selected it histograms the result. See: SET MODE MONITOR

NORMAL

NORMAL=ON selects a normal distribution with a cutoff at 4 sigma for the error DX. NORMAL=OFF selects a flat distribution from -DX to +DX. This is probably preferable for rebinning another histogram. (Default:NORMAL=ON)

X...

This specifies which axes to bin. X is always binned. If Y is specified then both X and Y are binned. After X or Y you should specify the FROM,TO,BY options if you wish to bin into a specific range, or step size. If you specify Y without MESH then a set of data sets are produced, each for a different Y.

VALUES

Normally FROM,TO specify the edges of the minimum, maximum bins. When VALUES=ON then they specify the center of the bins.

histograms

You may add together 2 histograms or average together 2 histograms with different bin widths. You should specify the correct DX and DY for each data set you wish to add. You probably also wish to use NORMAL=OFF

If you do not specify FROM, TO ... a set of values is assumed. First if you are binning 2 histograms with equally spaced equivalent values, then the same X values are assumed. Otherwise the current X tick spacing is used.

Example

Say you wish to find the frequency distribution of a set of student grades in 5 point steps. The following will do the job: TD:SET ORDER X (Enter grades) TD:Grade1; Grade2; Grade3..... TD:Graden;....... TD:BIN BY 5 (now do the binning) TD:HISTOGRAM Suppose you wish to add together 2 HBOOK histograms. Each histogram contains counts, but the X spacing is different. TD:SET HIST HBOOK ID=n1 TD:SET HIST ID=n2 APPEND You now have both hists in memory. TD:BIN NORMAL=OFF You now have both histograms added together. If both histograms had the same X values/bin then the result will have the same X values as the original.