multiYAxis: Add multiple text labels to the left axis of a plot

multiYAxisR Documentation

Add multiple text labels to the left axis of a plot

Description

Adds columns of labels to the left axis of a plot e.g. for displaying multiple pieces of information for each row of a heatmap

Usage

multiYAxis(
  pos,
  labs,
  spacer = 0.3,
  start = 1,
  cex = 1.1,
  axisArgs = list(),
  align = c("l", "c"),
  ...
)

Arguments

pos

position of axis labels in user coordinates

labs

a data.frame with each column giving a set of information to display in a column to the left of the plot

spacer

amount of space to leave between the widest text in each column. Specified in lines

start

where to start the axis labels i.e. the right side of the widest teXt in righmost column. Specified in lines

cex

character size for labels

axisArgs

a list of additional arguments for axis

align

either 'c' for centered text or 'l' for left justified text

...

additional arguments to text

See Also

image, text

Examples

par(mar=c(4,10,1,1))
plot(1:10,1:10,ylab='',yaxt='n')
multiYAxis(1:10,data.frame('a'=1:10,'b'=91:100,'c'=c('Longword','Word',1:8),stringsAsFactors=FALSE))
plot(1:10,1:10,ylab='',yaxt='n')
multiYAxis(1:10,data.frame('a'=1:10,'b'=91:100,'c'=c('Longword','Word',1:8),
  stringsAsFactors=FALSE),align='c')

sherrillmix/dnar documentation built on July 18, 2022, 10:07 p.m.