showLegend

0th

Percentile

showLegend

The function showLegend is an example for generating legend in the figure of heatmap3 function. You can use your any plot functions to generate your own legend.

Usage
showLegend(legend = c("Group A", "Group B"), lwd = 3, cex = 1.1, col = c("red", "blue"), ...)
Arguments
legend
a character or expression vector of length $\ge 1$ to appear in the legend. Other objects will be coerced by as.graphicsAnnot.
lwd
the line widths for lines appearing in the legend.
cex
character expansion factor relative to current par("cex"). Used for text, and provides the default for pt.cex and title.cex.
col
the color of points or lines appearing in the legend.
...
additional arguments passed on to legend
Aliases
  • showLegend
Examples
RowSideColors<-rep("steelblue2",nrow(mtcars))
RowSideColors[c(4:6,15:17,22:26,29)]<-"lightgoldenrod"
RowSideColors[c(1:3,19:21)]<-"brown1"
heatmap3(mtcars,scale="col",margins=c(2,10),RowSideColors=RowSideColors,legendfun=function()
showLegend(legend=c("European","American","Japanese"),col=c("steelblue2","lightgoldenrod",
"brown1"),cex=1.5))
Documentation reproduced from package heatmap3, version 1.1.1, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.