Skip to content
Prev 33059 / 398506 Next

small plot inside a big plot

Remko Duursma wrote:
You might want to play with the argument "plt" in par(), see ?par for
details. Example:

 plot(1:10)
 par("plt" = c(0.6, 0.9, 0.3, 0.5))
 par(new = TRUE)
 hist(rnorm(10))


layout() might also help, if your "small" plot is somewhere within a
grid:

 plot(1:10)
 layout(matrix(c(0,0,0,1), ncol=2))
 par(new = TRUE, oma = par("mar"))
 hist(rnorm(10))

 
Or look into package "grid" for more sophisticated but (from my point of
view) less easy solutions.

Uwe Ligges