plot_netassoc_matrix: Plots matrix with colormap

View source: R/plot.R

plot_netassoc_matrixR Documentation

Plots matrix with colormap

Description

Plots species x species or species x site matrix with color map

Usage

plot_netassoc_matrix(data, 
  colors, onesided=FALSE, main="", 
  legend=TRUE, axis=TRUE, title=TRUE, cex.axis=0.5)

Arguments

data

Input matrix; assumed to have dimension names

colors

Vector of colors

onesided

If TRUE, assumes that colors maps to an entirely positive or entirely negative scale, i.e. without zero-crossings.

main

Title of plot.

legend

If TRUE, plots a colorbar legend.

axis

If TRUE, labels axes with dimension names.

title

If TRUE, plots a title.

cex.axis

Expansion factor for axis labels.

Value

None; used for the side effect of making a plot.

Examples

nsp <- 10
nsites <- 30
obs <- matrix(rpois(n=nsp*nsites,10),
  nrow=nsp,ncol=nsites,
  dimnames=list(paste("Species",1:nsp),paste("Site",1:nsites)))
plot_netassoc_matrix(obs, onesided=TRUE, col=heat.colors(5))

int <- matrix(rnorm(n=nsp^2),
  nrow=nsp,ncol=nsp,
  dimnames=list(paste("Species",1:nsp),paste("Species",1:nsp)))
plot_netassoc_matrix(int, onesided=FALSE, 
  col=colorRampPalette(c("red","white","blue"))(50))

netassoc documentation built on July 20, 2022, 5:06 p.m.