[R] draw partition lines

Greg Snow Greg.Snow at imail.org
Mon Mar 10 17:41:05 CET 2008


Here is one approach (you can adapt as needed):

library(TeachingDemos)

par(mfrow=c(4,2))

plot(1:10)
plot(10:1)
plot(c(1:5,5:1))
plot(c(5:1,1:5))

tmp <- cnvrt.coords(1,0, input='fig')$usr # get right end coord
tmp2 <- cnvrt.coords(0,NA, input='tdev')$usr # get left end 
par(xpd=NA) # turn off clipping
segments(tmp$x,tmp$y,tmp2$x,tmp$y, col='blue')

hist(rnorm(10))
hist(rnorm(100))
hist(rnorm(3))
hist(rnorm(10000))

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of questions?
> Sent: Saturday, March 08, 2008 4:44 PM
> To: r-help at r-project.org
> Subject: [R] draw partition lines
> 
> I am using par(mfrow(4,2)...) to plot multiple graphs in one frame.
> However, the plots naturally partitioned into two sets, the 
> first two rows and the 3rd and 4th row are slightly 
> different, I want them to be in one frame, but I also want to 
> draw a line (or something to make top two rows/bottom two 
> rows look slightly
> different) in between them?
> 
> Any suggestions?
> 
> Thanks
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 



More information about the R-help mailing list