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 = text Title for the graph; default * i.e. none
WINDOW = scalar Window for the graph; default 3
YTITLE = texts Title for the y-axis
XTITLE = texts Title for the x-axis
YMARKS = scalars or variates Distance between each tick mark on y-axis (scalar) or positions of the marks (variate)
XMARKS = scalars or variates Distance between each tick mark on x-axis (scalar) or positions of the marks (variate)
YMPOSITION = string tokens Position of the tick marks across the y-axis (left, right, centre); default left
XMPOSITION = string tokens Position of the tick marks across the x-axis (above, below, centre); default * i.e. none
YLABELS = texts Labels at each mark on y-axis
XLABELS = texts Labels at each mark on x-axis
PENAXES = scalar Pen to be used for axes and their titles; default 1
PENTITLE = scalar Pen to use for the title; default 1
LINETHICKNESS = scalar Thickness for the vertical lines representing the mass heights; default 1
SCREEN = string token Whether to clear screen before displaying the graph (keep, clear); default clea

Parameters

Y = variates Heights for the masses
LINECOLOUR = texts or scalars 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.

See also

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

Was this article helpful?