colorbar | R Documentation |
The function adds a color bar to plot.
colorbar(
colors,
x,
y = NULL,
direction = "vertical",
height = 1,
width = 1,
border = "black",
lwd = 2,
lty = 1,
labs = NULL,
labs.pos = NULL,
title = NULL,
title.pos = NULL,
ticks = TRUE,
tck.pos = NULL,
tck.length = 1,
xpd = FALSE,
...
)
colors |
vector of colors. |
x, y |
the x and y coordinates where the bottom left corner of the bar is
positioned. Keywords as in |
direction |
either |
height |
a number indicating the amount by which the height of the bar should be scaled relative to the default. |
width |
a number indicating the amount by which the width of the bar should be scaled relative to the default. |
border |
color of the border around the bar. Set |
lwd |
border line width. |
lty |
border line type. |
labs |
the vector of labels to place next to the bar. |
labs.pos |
either |
title |
the title to be placed next to the bar. |
title.pos |
either on the |
ticks |
logical indicating whether ticks should be drawn next to each label. |
tck.pos |
indicates whether ticks should be plotter |
tck.length |
tick lengths |
xpd |
a value of the |
... |
further arguments passed to the functions |
Silvia Castiglione
rainbow(30)->cols
replicate(4,paste(sample(letters,4),collapse=""))->labs
plot(rnorm(20),rnorm(20))
colorbar(cols,"topleft")
plot(rnorm(20),rnorm(20))
colorbar(cols,"topright",
height=1.2,width=1.2,lwd=2,
labs=labs,labs.pos="left",labs.cex=1.3,labs.adj=1,
title="Colorbar!",title.cex=1.4,title.font=2,title.adj=c(0,0),
tck.pos="out",tck.lwd=2,xpd=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.