pitchplot {praatpicture}R Documentation

Plot pitch object

Description

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

Usage

pitchplot(
  pt,
  start,
  end,
  tfrom0 = TRUE,
  tgbool = FALSE,
  lines = NULL,
  focusTierColor = "black",
  focusTierLineType = "dotted",
  plotType = "draw",
  scale = "hz",
  freqRange = NULL,
  semitonesRe = 100,
  color = "black",
  ind = NULL,
  min_max_only = TRUE,
  axisLabel = NULL
)

Arguments

pt

PitchTier object loaded using rPraat::pt.read

start

Start time (in seconds) of desired plotted area.

end

End time (in seconds) of desired plotted area.

tfrom0

Logical; should time on the x-axis run from 0 or from the original time? Default is TRUE.

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'.

plotType

String giving the type of pitch plot to produce; default is draw (a line plot), the only other option is speckle (a point plot). Alternatively a vector c('draw','speckle') can be passed, in which case both are used.

scale

String giving the frequency scale to use when producing pitch plots. Default is hz; other options are logarithmic (also in Hz), semitones, erb, and mel.

freqRange

Vector of two integers giving the frequency range to be used for producing pitch plots. Default is NULL, in which case the pitch range is automatically reset to c(-12,30) for the semitones scale, c(0,10) for the erb scale, and c(50,500) for the Hz-based scales, following Praat defaults.

semitonesRe

Frequency in Hz giving the reference level for converting pitch frequency to semitones. Default is 100.

color

String giving the name of the color to be used for plotting pitch. Default is 'black'.

ind

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

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.

axisLabel

String giving the name of the label to print along the y-axis when printing a pitch track. Default is NULL, in which case the axis label will depend on the scale.

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='pitch')

[Package praatpicture version 1.2.0 Index]