waveplot {praatpicture}R Documentation

Plot waveform

Description

Function for plotting waveforms called by praatpicture. Instead of using this function directly, just use praatpicture('my_sound_file', frames='sound').

Usage

waveplot(
  sig,
  bit,
  t,
  nchan = 1,
  color = "black",
  tgbool = FALSE,
  lines = NULL,
  focusTierColor = "black",
  focusTierLineType = "dotted",
  ind = NULL,
  line_comp = NULL,
  rect_comp = NULL,
  arr_comp = NULL,
  annot_comp = NULL,
  draw_lines = NULL,
  draw_rectangle = NULL,
  draw_arrow = NULL,
  annotate = NULL,
  channelNames = FALSE,
  cn = NULL,
  min_max_only = TRUE
)

Arguments

sig

Numeric vector corresponding to a sound signal.

bit

Numeric; will generally be grabbed from a loaded WaveMC object.

t

Numeric vector giving times corresponding to the signal.

nchan

Numeric; how many channels will be plotted? Default is 1.

color

String giving the name of the color to be used for plotting the waveform. Default is 'black'. Alternatively, a vector of colors, if different channels should be plotted with different colors.

tgbool

Logical; should dotted lines be plotted corresponding to locations in a TextGrid? Default is FALSE.

lines

Numeric vector giving locations in seconds of locations from a TextGrid to be plotted with dotted lines. Default is NULL.

focusTierColor

String or vector of strings giving the color(s) to use for plotting focus tier lines. If multiple tiers are focused, a vector of the same length can be passed, and the nth tier will be plotted in the nth color. Default is 'black'.

focusTierLineType

String or vector of strings giving the line type(s) for plotting focus tier lines. If multiple tiers are focused, a vector of the same length can be passed, and the nth tier will be plotted in the nth line type. Default is 'dotted'.

ind

Integer indexing waveform relative to other plot components. Default is NULL.

line_comp

Vector of strings or numbers giving plot components to draw straight lines on. Default is NULL.

rect_comp

Vector of strings or numbers giving plot components to draw rectangles on. Default is NULL.

arr_comp

Vector of strings of numbers giving plot components to draw arrows on. Default is NULL.

annot_comp

Vector of strings of numbers giving plot components to annotate. Default is NULL.

draw_lines

List of arguments for drawing straight lines passed from praatpicture(). Default is NULL.

draw_rectangle

List of arguments for drawing rectangles passed from praatpicture(). Default is NULL.

draw_arrow

List of arguments for drawing arrows passed from praatpicture(). Default is NULL.

annotate

List of arguments for annotating passed from praatpicture(). Default is NULL.

channelNames

Logical; should names of audio channels be printed on the y-axis? Default is FALSE.

cn

Vector of strings with channel names to be printed on the y-axis if channelNames is TRUE.

min_max_only

Logical; should only minimum and maximum values be given on the y-axis? Default is TRUE. Can also be a logical vector if some but not all plot components should have minimum and maximum values on the y-axis. Ignored for TextGrid component.

Value

No return values, called internally by praatpicture and sibling functions.

Examples

# Don't use directly
datapath <- system.file('extdata', package='praatpicture')
soundFile <- paste0(datapath, '/1.wav')
praatpicture(soundFile, frames='sound')

[Package praatpicture version 1.2.0 Index]