Learn R Programming

emuR (version 0.1.7)

mu.colour: Function for specifying color, linetype, and line-widths in EMU plotting functions.

Description

The function specifies color, linetype and linewidths in EMU plotting functions as is used mostly in calls from within plot.trackdata, plot.spectral, eplot, and dplot

Usage

mu.colour(labs, col = TRUE, linetype = FALSE, lwd = NULL, pch = NULL)

Arguments

labs
A vector of character labels
col
A code passed to the 'col' argument in plotting functions. There are four possibilities. Either logical, a character vector, or a numeric vector. In the first case, if TRUE, then a different numeric code is given for each unique label type. For example,
linetype
A code specifying linetypes, i.e. the values passed to lty in plotting functions.There are 2 possibilities. Either logical, a character vector, or a numeric vector. In the first case, if TRUE, then a different numeric code is given for each unique label
lwd
A code passed to the lwd argument in plotting functions. 'lwd' can be either a single element numeric vector, or its length must be equal to the number of unique types in labs. For example, if lwd=3 and if labs = c("a", "b", "a", "c"), then the output i
pch
A code passed to the pch argument in plotting functions. Functions in the same way as lwd above

Value

  • If it is a LISTRUE, use
  • colourA code for the color'
  • linetypeA code for the linetype
  • lwdA code for the line width
  • legendA list consisting of $legend$lab, $legend$lty and $legend$lwd that specify the parameters for the 'legend' function.

    ...

Details

Parameters are also supplied for use with the function 'legend'

See Also

plot.trackdata dplot eplot plot.spectral

Examples

Run this code
# examples will be given using the above functions
# b/w but with different linetypes
eplot(vowlax.fdat.5[,1:2], vowlax.l, col=FALSE, lty=TRUE)

# user-defined colors
eplot(vowlax.fdat.5[,1:2], vowlax.l, col=c("green", "blue", "red", "orange"))

# spectral plot, user-defined colors, the last one is dotted
# and with a line-thickness of 2
plot(vowlax.dft.5[1:20,], vowlax.l[1:20], 
col=c("green", "blue", "red", "orange"), 
fun=mean, lty=c(1, 1, 1, 2), lwd=c(1, 1, 1, 2))

# similar but using dplot()
dplot(vowlax.fdat[1:20,2], vowlax.l, 
col=c("green", "blue", "red", "orange"), 
lwd=c(1, 1, 1, 2), lty=c(1, 1, 1, 2))

# the default except plot everything with a dotted line and plotting symbol 4
dplot(vowlax.fdat[,2], vowlax.l, average=TRUE, lty=2, pch=4, type="b", xlim=c(40, 60))

# the default except plot everything with a dotted line and
# with double line thickness
eplot(vowlax.fdat.5[,1:2], vowlax.l, lty=2, lwd=2)

Run the code above in your browser using DataLab