Visualize two-dimensional data

Share:

Description

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

Usage

1
2
3
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.

Author(s)

Achim Tresch, Bjoern Schwalb

See Also

clusterplot, demotour, disco, colorpalette

Examples

1
2
3
4
5
6
7
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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.