[R] Plots inside a Plot

Uwe Ligges ligges at statistik.tu-dortmund.de
Mon Nov 1 17:24:25 CET 2010



On 01.11.2010 12:20, Barry Rowlingson wrote:
> On Mon, Nov 1, 2010 at 11:10 AM, Uwe Ligges
> <ligges at statistik.tu-dortmund.de>  wrote:
>> Not in R base graphics, but you can do easily with the grid package.
>
>   You can do anything in R base graphics! Sometimes it's been done for
> you, sometimes you just have to draw the whole thing yourself using
> lines().
>
>   In this case, someone has already done it for you. subplot() in package Hmisc:
>
>   >  require(Hmisc)
>   >  plot( 11:20, sample(51:60) )
>   >  subplot( hist(rnorm(100)), 15, 55)
>
> Barry

Actually, it only works if your subplot does not contain "sub"plots 
itself. Try:

  plot( 11:20, sample(51:60) )
  subplot(pairs(iris), 15, 55)

and find it won't work.
So my corrected answer is: "In general not in R base graphics." ;-)

Best wishes,
Uwe



More information about the R-help mailing list