Description Usage Arguments Details Value Author(s) Examples
View source: R/createColorBar.R
A convenience function to create a color bar on the current graphics device.
1 2 | createColorBar(colors, top.text=NULL, bottom.text=NULL,
lower=-0.5, upper=0.5, x.pos=0, width=1, cex=1.5)
|
colors |
A character vector of colors to be used in successive steps of the color bar, from bottom to top. |
top.text |
String containing the label to be placed at the top of the color bar. |
bottom.text |
String containing the label to be placed at the bottom of the color bar. |
lower |
Numeric scalar specifying the bottom y-coordinate of the color bar. |
upper |
Numeric scalar specifying the top y-coordinate of the color bar. |
x.pos |
Numeric scalar specifying the x-coordinate of the middle of the color bar. |
width |
Numeric scalar specifying the width of the color bar. |
cex |
Numeric scalar specifying the size of the text. |
If bottom.text
or top.text
are not specified, they will be take from the first and last names of colors
, respectively.
If no names are available, no labels will be created.
A color bar is created on the current graphics device.
NULL
is invisibly returned.
Aaron Lun
1 2 | plot(0,0, axes=FALSE, xlab="", ylab="")
createColorBar(heat.colors(100), "High", "Low")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.