Heatplus (version 2.18.0)

doLegend: A simple legend

Description

Add a simple legend in form of a color bar to a plot.

Usage

doLegend(breaks, col, side)

Arguments

breaks
a vector of breaks defining a set of intervals for the data
col
a vector of colors corresponding to the intervals.
side
integer between 1 and 4, indicating on which side of the main plot the legend is supposed to be drawn. Standard interpretation: 1 = below, continuing clock-wise.

Value

axis

Details

This is an extremely simple way of giving a visual impression of what numerical values correspond to a given color. The actual plot is done via a call to image and axis.

See Also

plot.annHeatmap, niceBreaks, g2r.colors

Examples

Run this code
    ## Set up data
    doLegend(1:9, g2r.colors(8), 2)

Run the code above in your browser using DataLab