Skip to contents

Draws one bar trace per row of matrix, coloured and legended by row, with columns along the x axis. Used by the barplot module, and by interactive_count_barplot to render feature-annotation category counts.

Usage

interactive_barchart(
  matrix,
  barmode = c("stack", "group", "overlay"),
  ylab = "",
  palette_name = COLORBLIND_PALETTE_NAME,
  title = NULL
)

Arguments

matrix

A matrix to plot, e.g. counts by category (row) and sample (column)

barmode

'stack' (default), 'group' or 'overlay'. For 'overlay', rows are reordered by decreasing mean so each is more likely to be visible

ylab

Y axis label

palette_name

Valid R color palette name

title

Plot title

Value

output A plotly htmlwidget

Examples

m <- matrix(1:6, nrow = 2, dimnames = list(c("up", "down"), c("s1", "s2", "s3")))
interactive_barchart(m, barmode = "stack", ylab = "Count")