legendHist: Add histogram to existing plot

Description Usage Arguments Value Examples

View source: R/legendHist.R

Description

Add histogram at pleace of legend using colors from 'colorRamp'.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
legendHist(
  x,
  colRamp = NULL,
  location = "bottomright",
  legTit = NULL,
  cex = 0.7,
  srt = 67,
  offS = NULL,
  border = TRUE,
  silent = FALSE,
  callFrom = NULL
)

Arguments

x

(numeric) main input/component of plot

colRamp

(character or integer) set of colors, default is rainbow-like

location

(character) for location of histogram inside existing plot (may be 'br','bl','tl','tr','bottomright', 'bottomleft','topleft','topright')

legTit

(character, length=1) optional title for histogram-insert

cex

(numeric) expansion factor (see also par)

srt

(numeric) angle for histogram text labels (90 will give vertical label) (see also par)

offS

(NULL or numeric, length=5) fine-tuning of where histogram-insert will be placed and how elements therein are ditributed (default c(xOff=0.2,yOff=0.25,leftOffS=0.05, upperBarEnd=1.05,txtOff=0.02), 1st and 2nd determine proportio of insert relative to entire plotting region, 3rd defines space left on bottom for text, 4th if bars hit ceiling of insert or proportion to leave, 5th for shifting text towards top when turned other than 90 degrees )

border

(logical) decide of draw gray rectangle or not around legend

silent

(logical) suppress messages

callFrom

(character) allow easier tracking of message(s) produced

Value

figure

Examples

1
2
dat <- rnorm(90); plot(dat)
legendHist(dat, col=1:5)

wrGraph documentation built on April 12, 2021, 1:07 a.m.