plotInPlot: make a plot in a plot

Description Usage Arguments Examples

View source: R/plotInPlot.R

Description

make a plot in a plot

Usage

1
2
plotInPlot(minor.plot, coords = "topright", scale = 1/3, stay = F,
  bg.col = rgb(0, 0, 0, 0))

Arguments

minor.plot

is a function with no parameters that plots the smaller plot

coords

= x1,y1,x2,y2

stay:

acts like 'add' in the 'plot' function. The default is FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x <- rnorm(10000)
plot(density(x),ylim=c(0,.5))

minor <- function() {
  plot(x,type="l",main="Trace",cex.main=.8,bty="n",cex.axis=.5) 
}

plotInPlot(minor,c(1,4,.4,.5))
plotInPlot(minor,"topright")
plotInPlot(minor,"bottomright")
plotInPlot(minor,"bottomleft")
plotInPlot(minor,"topleft")

luiarthur/rcommon documentation built on Jan. 18, 2021, 12:45 a.m.