Here are a couple of options that may get you started: library(TeachingDemos)
plot(1:10, 1:10, type='n') abline(0,1) rhist <- function(x){ tmp <- hist(x, plot=FALSE) barplot(tmp$counts, horiz=TRUE, axes=FALSE, space=0) } subplot( rhist(rnorm(100)), 2,2, hadj=0 ) subplot( rhist(rnorm(100)), 5,5, hadj=0 ) subplot( rhist(rnorm(100)), 7,7, hadj=0 ) y <- seq(-3,3, len=100) x <- dnorm(y) x <- x/(max(x)) ms.norm <- cbind(x,y) plot(1:10,1:10, type='n') abline(0,1) my.symbols( 1:10, 1:10, ms.norm, inches=0.3 ) plot(1:10,1:10, type='n') abline(0,1) my.symbols( 1:10, 1:10, ms.norm, inches=seq(.2,.5,len=10) ) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Chang jun xiang > Sent: Friday, November 02, 2007 8:09 AM > To: r-help@r-project.org > Subject: [R] add histograms or distributions on regression line > > hello, does anyone know how to add histograms or > distributions on regression like just like quantiles > regression in RGraphGallery below, a very delicate codes. Thanks alot. > > http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=109 > > ______________________________________________ > R-help@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. > ______________________________________________ R-help@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.