bubbleHMLegends {bubbleHeatmap} | R Documentation |
Build Legend Trees for bubbleHeatmap Plots
Description
Generate a bubble size legend and/or color legend for bubbleHeatmap plots.
Usage
bubbleHMLegends(
sizeBreaks,
colorBreaks,
colorSeq,
unitBase,
diameter,
context,
legendHeight,
legendTitles,
showBubbleLegend = TRUE,
showColorLegend = TRUE,
name = "Legends",
orientation = c("horizontal", "vertical")
)
Arguments
colorBreaks , sizeBreaks |
Character vectors of legend tick labels. The
min/max values will represent the range of color/size scales. If not supplied
then these will be generated using |
colorSeq |
Character vector of colors to be used in creating color scale. |
unitBase |
|
diameter |
Maximum diameter of bubbles as multiple of unitBase. |
context |
|
legendHeight |
Numeric, preferred height of legends in multiples of
|
legendTitles |
Character vector of legend titles. First string should be the size legend title, second for the color legend. |
showColorLegend , showBubbleLegend |
Should plot include legends for color scale/bubble size? |
name |
character string naming the gTree containing the function output. |
orientation |
one of "horizontal" or "vertical", (default horizontal) indicating whether legends should be arranged stacked or side by side. Ignored if only one legend is required. |
Value
A gTree
object representing the bubbleHeatmap
legends requested by the showBubbleLegend and showColorLegend parameters.
See Also
Other build functions:
bubbleHeatmapList()
,
bubbleHeatmap()
,
multiPlotInput()
Examples
legends <- bubbleHMLegends(
sizeBreaks = seq(0, 80, 10), colorBreaks = seq(-2, 2, 0.5), diameter = 0.8,
context = gpar(cex = 0.8), colorSeq = c("#053061", "#2166AC", "#4393C3", "#92C5DE", "#D1E5F0",
"#FDDBC7", "#F4A582", "#D6604D", "#B2182B", "#67001F"), unitBase = unit(0.5, "cm"),
legendHeight = 9, legendTitles = c("Estimate", "NegLog10P"))
grid.draw(legends)