Chapter 12. Generating Graphics with Splus

Table of Contents
One dimensional plots
Ellipse plotting
Plotting signal files for a single utterance
Plotting segment data: Multiple plots
Plotting segment data: superimposed plots

The following is a description of some of the plotting functions which have been specifically written in Emu for analysing speech data. All of these plots are built on S-plus graphical primitives. See e.g. the S-plus plotting functions plot, barplot, hist.

One dimensional plots

Histogram plots

The Emu function hplot can be used to plot histograms of a single acoustic parameter for multiple types of segments. It takes two obligatory arguments: a vector of values, and a parallel label vector to relate the vector to different labels.

In this example, a histogram is plotted of the F2 values at the segment midpoint of [i:] (e.g. heed) [o:] (hoard) and [A] (had) vowels from the database.

segs _ emu.query("demo", "*", "Phonetic=i:|o:|A") 
vals _ emu.track(segs, "fm", cut=0.5)
hplot(vals[,2], label(segs), xlab="F2 Frequency (Hz)")
        

Fitting a normal curve to data

The function nplot can be used to fit a normal curve to single parameter data. Like hplot, it takes two required arguments: a vector of parameter values, and a parallel label file.

This example uses the same data as in the nplot example above:

nplot(vals[,2], l.segs, xlab="F2 Frequency (Hz)")
      

Figure 12-1 shows the results of these two examples.

Figure 12-1. Examples of hplot (upper) and nplot (lower).

Note that if the second argument, the parallel vector of labels, is omitted, then nplot assumed all tokens to belong to a single class, and one normal curve for all tokens is plotted.