Learn R Programming

phytools (version 0.3-72.1)

add.color.bar: Add color bar to a plot

Description

This function adds a color bar to a plot created by plotBranchbyTrait. The only way to add the color bar at present is by clicking on the desired location within your plot. It is also used internally by plot.contMap and plot.densityMap.

Usage

add.color.bar(leg, cols, title=NULL, lims=c(0,1), digits=1, prompt=TRUE,
	lwd=4, outline=TRUE, ...)

Arguments

leg
numerical value for the length of the legend.
cols
colors for the legend.
title
text to plot above the bar.
lims
range for the bar.
digits
digits for plotted numbers.
prompt
logical value indicating whether the location of the legend should be obtained interactively.
lwd
width of the plotted bar.
outline
logical value indicated whether or not to outline the plotted color bar with a 1 pt line.
...
optional arguments including: x x-coordinate of the legend (if prompt=FALSE); y y-coordinate of the legend; subtitle optional legend subtitle.

See Also

contMap, densityMap, plotBranchbyTrait