1. Home
2. DMASS procedure

# DMASS procedure

Plots discrete data like mass spectra, discrete probability functions (J.W. McNicol).

### Options

`X` = variate Positions on the x-axis at which to plot the lines; default uses 1, 2 … Title for the graph; default `*` i.e. none Window for the graph; default 3 Title for the y-axis Title for the x-axis Distance between each tick mark on y-axis (scalar) or positions of the marks (variate) Distance between each tick mark on x-axis (scalar) or positions of the marks (variate) Position of the tick marks across the y-axis (`left`, `right`, `centre`); default `left` Position of the tick marks across the x-axis (`above`, `below`, `centre`); default `*` i.e. none Labels at each mark on y-axis Labels at each mark on x-axis Pen to be used for axes and their titles; default 1 Pen to use for the title; default 1 Thickness for the vertical lines representing the mass heights; default 1 Whether to clear screen before displaying the graph (`keep`, `clear`); default `clea`

### Parameters

`Y` = variates Heights for the masses Colours for the vertical lines representing mass heights; default `*` sets suitable colours automatically

### Description

`DMASS` produces plots appropriate for ordered discrete data such as mass spectra, discrete probability functions or principal component weights. The `Y` parameter specifies one or more variates, each of which defines the heights of a set of vertical lines. By default the lines are plotted at equal unit spacing along the x-axis (i.e. at positions 1, 2 and so on), but other positions can be specified using the `X` option. The `X` and `Y` variates must all have equal lengths. So, for example, if a particular line is absent for one of the spectra, the variate must contain a zero value. The `LINECOLOUR` parameter defines the colour to be used for each set. By default, the standard colours are used in the same order as for pens 2, 3… (see `PEN`).

As usual, options `TITLE`, `WINDOW` and `SCREEN` allow you to define a title for the plot, specify which window to use, and indicate whether or not to clear the screen beforehand. Likewise, options `YTITLE`, `XTITLE`, `YMARKS`, `XMARKS`, `YMPOSITION`, `XMPOSITION`, `YLABELS` and `XLABELS` define titles, tick marks and labelling of the axes, similarly to the `XAXIS` and `YAXIS` directives. The pens to use for the title and for the axes can be defined by the `PENTITLE` and `PENAXES` options, and the `LINETHICKNESS` option controls the thickness of the lines used to plot the masses.

Options: `X`, `TITLE`, `WINDOW`, `YTITLE`, `XTITLE`, `YMARKS`, `XMARKS`, `YMPOSITION`, `XMPOSITION`, `YLABELS`, `XLABELS`, `PENTITLE`, `PENAXES`, `LINETHICKNESS`, `SCREEN`.

Parameters: `Y`, `LINECOLOUR`.

### Method

For the ith mass, a pair of variates of length 2 is created; y=[mass,0] and x=[i,i]. These are plotted by the `DGRAPH` directive with `METHOD=line`.

### Action with `RESTRICT`

`DMASS` takes account of restrictions on `X` or any of the `Y` variates.

Procedures: `BARCHART`, `DPROBABILITY`, `RUGPLOT`.

Commands for: Graphics.

### Example

```CAPTION 'DMASS example'; STYLE=meta
VARIATE [VALUES=3,5,6,7,3,4,-1,-2,-3,-5,3,-4,3,-4,-7,-3,5] Spectrum[1]
&       [VALUES=2,4,7,7,4,5, 0,-1,-3,-6,2,-7,1,-1,-4,-4,1] Spectrum[2]
DMASS   [TITLE='spectra'] Spectrum[]
```
Updated on March 8, 2019