spec

Software for Diffraction

1.3.13. - Plotting and Data Analysis



spec's internal plotting and analysis facilities are currently limited to ASCII character plots on the screen or printer and operations such as finding the center and the full width at half maximum (FWHM) of a peak. The C-PLOT package provides most users with the sophisticated plotting and fitting capabilities that spec lacks.

Up to 8,192 pairs of points can be maintained by spec's plotting and analysis functions. The pl_put(i, x, y) function loads the x and y arguments into the element indexed by i. The pl_xget(i) and pl_yget(i) functions return the x-value or the y-value stored in position i.

Analysis is done using the pl_anal(code) function, which returns a value derived from the stored data according to the value of code. For example, pl_anal(5) returns the full width at half maximum of the peak. See page ## in the Reference Manual for a complete description of the values returned by pl_anal().

Typically, the inner loop of a scan calls pl_put() for each data point. The plotting macros then use the available analysis routines to find the minimum and maximum of each axis and use pl_xget() and pl_yget() to plot each point. The plot_res, rplot_res and splot_res macros are defined to print the derived quantities such as peak position, integrated intensity, etc. in different contexts.