LSD (version 4.0-0)

plotmatrix: Visualize two-dimensional data

Description

Plot the rows of a matrix as lines along the cols.

Usage

plotmatrix(input, xlim = NULL, ylim = NULL, xlab = "", ylab = "",
  main = "plotmatrix", type = "l", lwd = 2, at = NULL, xlabels = NULL,
  ltys = NULL, add = FALSE, cols = NULL, ...)

Arguments

input

a matrix with numerical entries.

xlim

x limits, standard graphics parameter.

ylim

y limits, standard graphics parameter.

xlab

x lab, standard graphics parameter.

ylab

y lab, standard graphics parameter.

main

title of the plot, standard graphics parameter.

type

what 'type' of plot should be drawn (to be passed to points).

lwd

a positive number giving the line width.

at

a integer vector containing the x-positions corresponding to the columns of 'input'.

xlabels

a character vector containing labels for the x-axis.

ltys

a numeric vector giving the line types for each row of 'input'.

add

logical: if TRUE (FALSE by default), lines are added to existing plot.

cols

a character vector of R build-in colors.

...

additional parameters to be passed to points and plot.

See Also

clusterplot, demotour, disco, colorpalette

Examples

Run this code
# NOT RUN {
len = 20
x = sin(seq(0,2*pi,length=len*2))
fun = function(){n=sample(1:len,1); return(x[n:(n+len-1)])}
input = t(replicate(7,fun(),simplify=TRUE))
input = input + rnorm(length(input))/2

plotmatrix(input,cols=1:7)
# }

Run the code above in your browser using DataCamp Workspace